The only problem is the result is stereo and I need it to be mono, so if there's another solution I'm happy to hear it! ogg file using Jorbis to convert it to PCM data. GetExternalStorageDirectory().getAbsolutePath()+"/stegDroid/un-ogged.wav")) Wfw.write(monoStream, Type.WAVE, new File(Environment. Here's code I tried that didn't work: WaveFileWriter wfw = new WaveFileWriter() ĪudioFormat format = new AudioFormat(Encoding.PCM_SIGNED, 44100, 16, 2, 2, 44100, false) ĪudioFormat monoFormat = new AudioFormat(Encoding.PCM_SIGNED, 44100, 16, 1, 2, 44100, false) īyte audioData = dataout.toByteArray() īyteArrayInputStream bais = new ByteArrayInputStream(audioData) ĪudioInputStream stereoStream = new AudioInputStream(bais,format,length) ĪudioInputStream monoStream = new AudioInputStream(stereoStream,format,length/2) Is converting it to mono just a case of skipping every other byte (after the header)? It's encoded in 16bit signed PCM format.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |