wav

Playing .wav files on DOSBox's Sound Blaster device

廉价感情. 提交于 2019-11-28 11:50:20
I want to make a program in assembly/8086/masm/dosbox that turns the keyboard into various musical instruments so i need to be able to play some .wav files to produce the required sounds.I am aware of beep char and producing sound via sending frequencies to pc speaker (ports 41h,42h and 61h) but both ways are clearly not going to get me there. I searched around and found that I need to use int 21h for opening files, knowledge of .wav format and knowledge of sound programming using Sound Blaster . Unfortunately I couldn't find any helpful documentation on how to use the Sound Blaster in Dosbox

Play wav file async multiple times with .net

你离开我真会死。 提交于 2019-11-28 11:39:30
I have an app that I need to play a wav file when a key is pressed, I use the SoundPlayer class but if another sound is being played when a new key is pressed, it stops the sound the play it again making it look ugly.... is there any way to play the same sound again even if there is another of being played? thanks! Use PlaySound from the windows API in combination with the SND_ASYNC and SND_NOSTOP flags. http://www.pinvoke.net/default.aspx/winmm.playsound Usage //And the actual usage PlaySound (fileName, UIntPtr.Zero, (uint)(SoundFlags.SND_FILENAME | SoundFlags.SND_ASYNC | SoundFlags.SND

Mean amplitude of a .wav in C#

a 夏天 提交于 2019-11-28 11:33:21
Does anyone know a way to get the mean amplitude of a .wav file using C# (even if it means calling an outside command line program and parsing the output)? Thanks! Here is a snip that reads in a stereo wav and puts the data in two arrays. It's untested because I had to remove some code (converting to mono and calculate a moving average) /// <summary> /// Read in wav file and put into Left and right array /// </summary> /// <param name="fileName"></param> private void ReadWavfiles(string fileName) { byte[] fa = File.ReadAllBytes(fileName); int startByte = 0; // look for data header { var x = 0;

Data returned by scipy.io.wavfile.read

大兔子大兔子 提交于 2019-11-28 11:24:28
I'm trying to get the data from a wav file in Python and plot it. When I use scipy.io.wavfile.read(), I get back an array that looks like this: [[ -1.49836736e-02 -1.27559584e-02] [ -1.84625713e-02 -1.63264061e-02] [ -2.17888858e-02 -1.95001373e-02] ..., [ 6.10332937e-05 6.10332937e-05] [ -3.05166468e-05 0.00000000e+00] [ 3.05166468e-05 -6.10332937e-05]] Why is it a bunch of arrays with length 2 as opposed to one long array with the value at each sample? What does this data being returned represent? Thanks in advance. convert_16_bit = float(2**15) sr, samples = scipy.io.wavfile.read(

Concatenate two audio files in Swift and play them

不打扰是莪最后的温柔 提交于 2019-11-28 10:30:59
I try to concatenate .wav audio files in swift. Here is my code : func merge(audio1: NSURL, audio2: NSURL) { var error:NSError? var ok1 = false var ok2 = false var documentsDirectory:String = paths[0] as! String //Create AVMutableComposition Object.This object will hold our multiple AVMutableCompositionTrack. var composition = AVMutableComposition() var compositionAudioTrack1:AVMutableCompositionTrack = composition.addMutableTrackWithMediaType(AVMediaTypeAudio, preferredTrackID: CMPersistentTrackID()) var compositionAudioTrack2:AVMutableCompositionTrack = composition

How to get PCM data from a wav file?

时光毁灭记忆、已成空白 提交于 2019-11-28 09:32:57
I have a .wav file. I want to get the PCM data from that sound file, so that I can get the individual data chunks from the sound and process it. But I don't know how to do it. Can anyone tell me how to do it? I have done this so far: public class test { static int frameSample; static int timeofFrame; static int N; static int runTimes; static int bps; static int channels; static double times; static int bufSize; static int frameSize; static int frameRate; static long length; public static void main(String[] args) { try { AudioInputStream ais = AudioSystem.getAudioInputStream(new File("music

What is the easiest way to read wav-files using Python [summary]?

落爺英雄遲暮 提交于 2019-11-28 08:44:00
I want to use Python to access a wav-file and write its content in a form which allows me to analyze it (let's say arrays). I heard that "audiolab" is a suitable tool for that (it transforms numpy arrays into wav and vica versa). I have installed the "audiolab" but I had a problem with the version of numpy (I could not "from numpy.testing import Tester"). I had 1.1.1. version of numpy. I have installed a newer version on numpy (1.4.0). But then I got a new set of errors: Traceback (most recent call last): File "test.py", line 7, in import scikits.audiolab File "/usr/lib/python2.5/site-packages

How to handle Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause()

淺唱寂寞╮ 提交于 2019-11-28 08:02:26
Below is my code in aspx page to allow playing audio's of wav format in the browser but with my current code i am unable to play wav audios in chrome browser but it works in mozilla firefox.How can i handle this exception <script> window.onload = function () { document.getElementById("audio").play(); } window.addEventListener("load", function () { document.getElementById("audio").play(); }); </script> <body> <audio id='audio' controls autoplay> <source src="Sounds/DPM317.wav" type="audio/wav" /> Your browser does not support the audio element. </audio> </body> Vladislav Nosenko For Chrome they

change wav file ( to 16KHz and 8bit ) with using NAudio

强颜欢笑 提交于 2019-11-28 07:48:39
I want to change a WAV file to 8KHz and 8bit using NAudio. WaveFormat format1 = new WaveFormat(8000, 8, 1); byte[] waveByte = HelperClass.ReadFully(File.OpenRead(wavFile)); Wave using (WaveFileWriter writer = new WaveFileWriter(outputFile, format1)) { writer.WriteData(waveByte, 0, waveByte.Length); } but when I play the output file, the sound is only sizzle. Is my code is correct or what is wrong? If I set WaveFormat to WaveFormat(44100, 16, 1), it works fine. Thanks. A few pointers: You need to use a WaveFormatConversionStream to actually convert from one sample rate / bit depth to another -

Comparison of two waveforms of audio files

拟墨画扇 提交于 2019-11-28 04:54:33
问题 I am a VC++ developer and currently need help in comparing two audio files. Lets say I have two wave files and one of it is created using the other with some modifications like lowering the loudness etc. Now, I have to compare these files and see if the modified one is almost copy of the original one, means, while creating the modified one, my application has unknowingly not distorted the file. A percentage value would be better to signify how much different these files are. I have tried