I am using your code for a mobile app project in which I need to record sounds and than playing them. As converting to mp3 is too CPU demanding for most devices your project just saved me. But I am experiencing some random errors. In one of my screen it works flawlessly, but in the other one I get an error when I play the wav file for the first time. Strangely when I call the method again, from the second time on it works without problems. Here is the error msg I get:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at org.as3wavsound::WavSound/load()[/Users/.../src/org/as3wavsound/WavSound.as:115]
at org.as3wavsound::WavSound()[/Users/.../src/org/as3wavsound/WavSound.as:102]
I went checking the WavSound class and I found those line might be the root of the problem:
public function WavSound(wavData:ByteArray, audioSettings:AudioSetting = null) {
load(wavData, audioSettings);
}
I imagine the source of the problem is the audioSettings values. Do you have any idea of how to solve this? I have tried a lot of things, and nothing works. Also, it is so strange that in one screen I don't have the problem but in another one I do, since I am using the code the exact same way in the exact same order...
I am using your code for a mobile app project in which I need to record sounds and than playing them. As converting to mp3 is too CPU demanding for most devices your project just saved me. But I am experiencing some random errors. In one of my screen it works flawlessly, but in the other one I get an error when I play the wav file for the first time. Strangely when I call the method again, from the second time on it works without problems. Here is the error msg I get:
I went checking the WavSound class and I found those line might be the root of the problem:
I imagine the source of the problem is the audioSettings values. Do you have any idea of how to solve this? I have tried a lot of things, and nothing works. Also, it is so strange that in one screen I don't have the problem but in another one I do, since I am using the code the exact same way in the exact same order...