Answer the question
In order to leave comments, you need to log in
Shine MP3 Encoder onAS3 Alchemy empty file
everything is quite simple:
I write the sound of a microphone using the MicRecorder
library.
Wav is saved to the computer via
fileReference.save(recorder.output, "recording.wav");
Everything is fine. But as soon as I run recorder.output like this
mp3Encoder = new ShineMP3Encoder(recorder.output);
mp3Encoder.saveAs();
Saving an empty file. The wav-ki processing time and its duration are written to the log, and all progress as a percentage.
But when saving the file 0 bytes(
Answer the question
In order to leave comments, you need to log in
You are using the class incorrectly ShineMP3Encoder
(I judge by the source code of this class).
After creating a variable mp3Encoder
, you must call the method . .start()
Moreover, you need to remember about the asynchrony of work ShineMP3Encoder
. That is, you cannot call .saveAs()
immediately after calling .start()
. You need to subscribe to an event Event.COMPLETE
and you can save the received MP3 file in the handler of this event. The code will look something like this
private function startEncoding() : void {
mp3Encoder = new ShineMP3Encoder(recorder.output);
mp3Encoder.addEventListener(Event.COMPLETE, onEncodingComplete);
mp3Encoder.start();
}
private function onEncodingComplete(event : Event) : void {
mp3Encoder.saveAs();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question