Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have had similar problem with a wav file. Let's start discarding some things:</p> <p>It is NOT a problem of waiting, although it may be in another cases. Please note that you have posted two DIFFERENT error messages like it were one:</p> <ol> <li>unable to load (null) </li> <li>sample 1 not ready</li> </ol> <p>The first error is raised when you try to load the sample into the SoundPool, the second one when you try to play it. But in this case the second error is clearly a consequence of the first one: the sample could not be ready if it has not been loaded.</p> <p>So you should concentrate before in the first error.</p> <p>It is NOT related to MediaPlayer neither, since you are using the SoundPool that is a different thing AFAIK.</p> <p>So the source of the problem may be, and should be discarded by order:</p> <ol> <li>The file is not there.</li> <li>The file is there, but it is not readable for some reason.</li> <li>The file is there, and it is readable, but it is corrupt or not an audio file.</li> <li>The file is there, and it is readable, and it is a non corrupted audio file, but SoundPool dislikes it.</li> </ol> <p>This last was my case. For some reason SoundPool were unable to load a wav sample that in fact works in every other player that I have used. So I simply ended using another file with a different format. Here is the format of the offending file, as told by mplayer on my GNU/LiNUX box:</p> <pre><code>Opening audio decoder: [pcm] Uncompressed PCM audio decoder AUDIO: 96000 Hz, 1 ch, s16le, 1536.0 kbit/100.00% (ratio: 192000-&gt;192000) Selected audio codec: [pcm] afm: pcm (Uncompressed PCM) </code></pre> <p>And here it is the one for the other file that does work:</p> <pre><code>Opening audio decoder: [pcm] Uncompressed PCM audio decoder AUDIO: 22050 Hz, 2 ch, s16le, 705.6 kbit/100.00% (ratio: 88200-&gt;88200) Selected audio codec: [pcm] afm: pcm (Uncompressed PCM) </code></pre> <p>There are many differences, but the point is that the second works, so I simply discarded the first one and move into the second. Knowing this if I needed the first sound sample, I just need to adjust its rate and channels with an audio editor like Audacity to solve the problem.</p> <p>Why it did not just work in first case? Who knows, but if I can solve it so easy... who cares at all?</p> <p>Regards,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload