|
|||
|
I have a problem with saving an audio recording:
when I save an audio recording it only saves "full seconds" which means that parts of the recording which are between - let's say - second 1 and second 2 are missing because the recording is only saved until second 1. I set the bytespersec rate and only since then I have this problem. My code goes like this: ------------------------------------------------------------------------------ //recording player = new MCI(); player.sendCmdString("open new type waveaudio alias myWave"); player.sendCmdString("set myWave format tag pcm"); player.sendCmdString("set myWave samplespersec 44100"); player.sendCmdString("set myWave bitspersample 16"); player.sendCmdString("set myWave channels 1"); player.sendCmdString("set myWave bytespersec 86000"); player.sendCmdString("set myWave time format ms"); player.sendCmdString("record myWave from 0 overwrite"); //saving FlashPlayer.bindData("id"); FlashPlayer.updateData(true); var myWave = Shell.getSpecialFolder("temp") + "\\" + FlashPlayer.id + ".wav"; player.sendCmdString("stop myWave"); player.sendCmdString("save myWave " + myWave + " wait"); player.sendCmdString("close myWave"); ------------------------------------------------------------------------------ If I don't set the bytespersec rate everything works fine except that the recorded file is no longer playable in the Windows Media Player or causes other players like the Realplayer or VLC-player to show a wrong file length (a file which is actually 11 seconds long appears to be 92 seconds in these players). Can anybody help out please? |
|
|||
|
Sometimes the solution is easier than one might think... I figured out the problem. The settings for the soundfile have to go in one single line/command:
player.sendCmdString("open new type waveaudio alias myWave"); player.sendCmdString("set myWave samplespersec 44100 bitspersample 16 channels 1 alignment 2 bytespersec 88200 format tag pcm time format ms"); Just in case somebody has the same problem, too ![]() |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|