wav

Android, How to play WAV file programmatically

你说的曾经没有我的故事 提交于 2019-12-01 17:17:48
I already have a .wav file in my directory. at the same time i need to play it together with a mp3 file. I used, String recordedFile = "/storage/sdcard0/PINOYKARAOKE/1373597371359.wav"; MediaPlayer recordedSong = new MediaPlayer(); try{ recordedSong = MediaPlayer.create(ctx, Uri.fromFile(recordedFile)); recordedSong.prepare(); recordedSong.start(); } catch(Exception e){ } error: creation failed and it throws IOException Try to create raw folder and put your file there, use this public void number(int num, Context ctx) { AssetManager am; try { am = ctx.getAssets(); AssetFileDescriptor afd = am

How to add metadata to WAV file?

旧巷老猫 提交于 2019-12-01 17:11:25
I'm looking for some sample code to show me how to add metadata to the wav files we create. Anyone? Try code below private void WaveTag() { string fileName = "in.wav"; WaveReadWriter wrw = new WaveReadWriter(File.Open(fileName, FileMode.Open, FileAccess.ReadWrite)); //removes INFO tags from audio stream wrw.WriteInfoTag(null); //writes INFO tags into audio stream Dictionary<WaveInfo, string> tag = new Dictionary<WaveInfo, string>(); tag[WaveInfo.Comments] = "Comments..."; wrw.WriteInfoTag(tag); wrw.Close(); //reads INFO tags from audio stream WaveReader wr = new WaveReader(File.OpenRead

Android, How to play WAV file programmatically

做~自己de王妃 提交于 2019-12-01 16:21:08
问题 I already have a .wav file in my directory. at the same time i need to play it together with a mp3 file. I used, String recordedFile = "/storage/sdcard0/PINOYKARAOKE/1373597371359.wav"; MediaPlayer recordedSong = new MediaPlayer(); try{ recordedSong = MediaPlayer.create(ctx, Uri.fromFile(recordedFile)); recordedSong.prepare(); recordedSong.start(); } catch(Exception e){ } error: creation failed and it throws IOException 回答1: Try to create raw folder and put your file there, use this public

Create .wav from multiple sine waves and play all at once [closed]

南楼画角 提交于 2019-12-01 14:49:00
I'm wondering if there is a way to adapt the code shown here so that I can basically make an array of beeps and play them all at once. I tried making global MemoryStream and BinaryWriter to use, calculating everything ahead of time for the size but it was even slower than 1 beep at a time and didn't seem to work. After that, I tried writing the MemoryStream to a byte array but that did the same as making globals for the stream/writer. How can I edit the code to get the MemoryStream to hold multiple beeps and play them all at once? Here is a modification to create the song from beeps: void Main

Play WAV files one after the other in Java

拥有回忆 提交于 2019-12-01 13:44:05
I'm trying to play a few WAV files after each other. I tried this method: for (String file : audioFiles) { new AePlayWave(file).start(); } But that plays them all at the same time. So I need a function that looks like this: public void play(Vector<String> audioFiles); The vector contains the files, for example: "test1.wav" , "test2.wav" I have been looking for over four hours, but I can't seem to find a working solution :( I also tried concatenating the WAV files to one AudioInputStream. It doesn't give any compiler errors, but the sound is totally messed up. Code: public static

Create .wav from multiple sine waves and play all at once [closed]

北城以北 提交于 2019-12-01 13:32:48
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I'm wondering if there is a way to adapt the code shown here so that I can basically make an array of beeps and play them all at once. I tried making global MemoryStream and BinaryWriter to use, calculating everything ahead of time for the size but it was even slower than 1 beep at a time and didn't seem to work.

Change Mixer to output sound to in java

徘徊边缘 提交于 2019-12-01 12:26:58
I am trying to play a wav/mp3 to my virtual audio cable, I have been searching for hours but can't seem to find how to achieve this. I have been able to play sound in both formats but I can't get it to output to 'Line-1' rather than 'Speakers' Any helpful links or example code would be greatly appreciated. Radiodef To get an array of all Mixer s on the current platform, you may use AudioSystem#getMixerInfo : static void printAllMixerNames() { for(Mixer.Info info : AudioSystem.getMixerInfo()) { System.out.println(info.getName()); } } If your virtual cable is available, it will be in the array.

Change Mixer to output sound to in java

限于喜欢 提交于 2019-12-01 11:20:14
问题 I am trying to play a wav/mp3 to my virtual audio cable, I have been searching for hours but can't seem to find how to achieve this. I have been able to play sound in both formats but I can't get it to output to 'Line-1' rather than 'Speakers' Any helpful links or example code would be greatly appreciated. 回答1: To get an array of all Mixers on the current platform, you may use AudioSystem#getMixerInfo: static void printAllMixerNames() { for(Mixer.Info info : AudioSystem.getMixerInfo()) {

Issues with scipy.io wave file processing after applying fourier transforms

大兔子大兔子 提交于 2019-12-01 11:01:23
I'm working with some audio files in Python using scipy.fftpack and scipy.io packages. What this implies is I have wave files that I am importing, playing around with them using Fourier transforms, and then outputting to a new wave file. I am however having running into issues where in after running these transforms, the wave file will not play and is roughly 4 times the size of the original file. Currently I'm just importing the song, taking the rate, data pieces from the import, doing ifft(fft(data)) and then outputting this. I have tried taking these float values and converting it to

C++ reading 16bit Wav file

被刻印的时光 ゝ 提交于 2019-12-01 10:44:38
I'm having trouble reading in a 16bit .wav file. I have read in the header information, however, the conversion does not seem to work. For example, in Matlab if I read in wave file I get the following type of data: -0.0064, -0.0047, -0.0051, -0.0036, -0.0046, -0.0059, -0.0051 However, in my C++ program the following is returned: 0.960938, -0.00390625, -0.949219, -0.00390625, -0.996094, -0.00390625 I need the data to be represented the same way. Now, for 8 bit .wav files I did the following: uint8_t c; for(unsigned i=0; (i < size); i++) { c = (unsigned)(unsigned char)(data[i]); double t = (c