Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Problem --- Cannot create FMOD::Sound instance for resource in Webgl Build/Editor

Discussion in 'Audio & Video' started by woud, Jul 5, 2015.

  1. woud

    woud

    Joined:
    Apr 8, 2015
    Posts:
    9
    Hi everyone, i have a Audio problem in Webgl build. I'm not sure if anyone else have seen this problem.

    I'm making a AudioCache to save AudioClip loaded from Assetbundle. After i use WWW to download Assetbundle from Server and ready to use assetbundle.LoadAssetAsync to get AudioClip, this error msg come.

    The code is here
    Code (CSharp):
    1. LoadedAssetBundle bundle = AssetManager.Instance.GetLoadedAssetBundle(_sAssetBundleName, out _sDownloadingError);
    2.         if (bundle != null)
    3.         {
    4.             _request = bundle.assetBundle.LoadAssetAsync(_sAssetName, _type);
    5.             return false;
    6.         }
    The sound file format is mp3, wav and ogg. I have test these sounds by using them in AudioSource directly, everything is ok. But afer bundled these can not be use... by the way, bundle code is paste on below:

    Code (CSharp):
    1. [MenuItem("Ozovr/BuildAssetBundle/TargetPlatform/WebGL")]
    2.     private static void BuildAssetBundleForWebGL()
    3.     {
    4.         BuildPipeline.BuildAssetBundles("Assets/AssetBundles/Webgl",
    5.             BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.DeterministicAssetBundle,
    6.             BuildTarget.WebGL);
    7.     }
    8.  
    And the AudioClip setting is here:
    QQ图片20150705214115.png

    ----------
    I buid this project to webgl and sounds can play.... but why in editor mode have this problem?
     
    Last edited: Jul 5, 2015
  2. woud

    woud

    Joined:
    Apr 8, 2015
    Posts:
    9
    I have change “Load In Background” to true, and nothing error logged, but the AudioClip's isReadyToPlay always false
     
  3. woud

    woud

    Joined:
    Apr 8, 2015
    Posts:
    9
    I have solved this problem, Unity3d editor mode don't support Webgl AudioSource Assetbundle.... I create a Standalone type Assetbundle and load it, everything is ok... i don't know how unity3d bundle audiosources with webgl mode....
     
    iLyxa3D likes this.
  4. raiden

    raiden

    Joined:
    Feb 8, 2009
    Posts:
    333
    I also solved my issue with this, by simply changing the import setting on the offending audio file, and "poof" error gone. :)
     
    Fenerax_Studios likes this.
  5. orson1

    orson1

    Joined:
    Dec 15, 2015
    Posts:
    1
    changed the import setting to what? can you be more explicit please? tnx
     
    AbgaryanFX, mmoczkowski and pacsman like this.
  6. raiden

    raiden

    Joined:
    Feb 8, 2009
    Posts:
    333
    I just changed the settings to this, and applied, and it fixed itself.

     
  7. GroundCombo

    GroundCombo

    Joined:
    Jan 23, 2015
    Posts:
    29
    I also have this problem when trying to build for iOS or Android on 5.3.1f. 5.2 builds without any problems (except for Cloud Build which crashes on the same FMOD error, for some reason). The build just breaks on some audio files. I had a longer explanation but the forum thinks it's spam no matter how I edit it and I don't have time to spare right now, so I'm just throwing this out there in hopes of more information. Googling gives more posts with the same issue.
     
  8. chmodseven

    chmodseven

    Joined:
    Jul 20, 2012
    Posts:
    108
    Thanks all, this also solved my issue I was having where the sounds clips were giving the FMOD error after I unloaded my asset bundle after unpacking it, but worked fine if I left the bundle loaded. Turning on the "Preload Audio Data" checkbox was what fixed it for me.
     
  9. PrachiB

    PrachiB

    Joined:
    Feb 19, 2016
    Posts:
    2
    I am also having some issues with Unity Audio While trying to build my IOS App
    It crashes immediately on load
    But if I disable Unity Audio in project Settings App runes fine.

    I am a beginner in unity development. and not an coder so using Fungus ..
    Can any one please guide me .. what should I do to make may App Working With Audio.

    getting bellow mentioned Error massage in Xcode before disabling Unity Audio


    -> applicationDidBecomeActive()
    Renderer: Apple Software Renderer
    Vendor: Apple Inc.
    Version: OpenGL ES 2.0 APPLE-12.0.40
    GLES: 2
    GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_vertex_array_object GL_EXT_blend_minmax GL_EXT_color_buffer_half_float GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_draw_instanced GL_EXT_instanced_arrays GL_EXT_map_buffer_range GL_EXT_occlusion_query_boolean GL_EXT_pvrtc_sRGB GL_EXT_read_format_bgra GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sRGB GL_EXT_texture_filter_anisotropic GL_EXT_texture_rg GL_EXT_texture_storage GL_APPLE_clip_distance GL_APPLE_color_buffer_packed_float GL_APPLE_copy_texture_levels GL_APPLE_framebuffer_multisample GL_APPLE_rgb_422 GL_APPLE_sync GL_APPLE_texture_format_BGRA8888 GL_APPLE_texture_max_level GL_APPLE_texture_packed_float GL_IMG_r
    ead_format GL_IMG_texture_compression_pvrtc
    OPENGL LOG: Creating OpenGL ES 2.0 graphics device
    Initialize engine version: 5.3.4f1 (fdbb5133b820)
    2016-05-22 14:49:50.637 ShunasEbook[2063:20634] 14:49:50.636 ERROR: >aqme> 300: Audio device 0xcb: error '!obj' fetching sample rate, or sample rate is 0. Defaulting to 44100.
    2016-05-22 14:49:50.637 ShunasEbook[2063:20634] 14:49:50.637 ERROR: 211: EXCEPTION thrown ('!dev'): -
    libc++abi.dylib: terminating with uncaught exception of type CAException
    (lldb)


    Thanks for any help!
     
  10. Fenerax_Studios

    Fenerax_Studios

    Joined:
    Sep 26, 2014
    Posts:
    1
    I checked 'Load in Background' on the audio clips and this solved it.
     
  11. danishsshaikh

    danishsshaikh

    Joined:
    Mar 15, 2019
    Posts:
    5
    From Where can i check them?
     
  12. rcpkmrk1848

    rcpkmrk1848

    Joined:
    Apr 18, 2019
    Posts:
    1
    You can check it from where the audio file is on the Project. Load in Background did not work for me. I also turned on "Force to Mono". Then solved.
     
  13. Raptosauru5

    Raptosauru5

    Joined:
    Feb 8, 2019
    Posts:
    23
    For me only the longer audio file was a problem so I tried to lower it's quality.
    The solution was to lower the sound clip QUALITY below 100% inside the import settings.
     
  14. sumitprof2017

    sumitprof2017

    Joined:
    Oct 29, 2019
    Posts:
    1
    UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(filepath+ audiofileName+".mp3", AudioType.MPEG)) ..change the audio type to the audio type like wav or mpeg or likewise
     
    elguncumayev likes this.