wavefile | Ruby gem for reading and writing sound files
kandi X-RAY | wavefile Summary
kandi X-RAY | wavefile Summary
A Ruby gem for reading and writing sound files in Wave format (*.wav). You can use this gem to create Ruby programs that work with audio, such as a command-line drum machine. Since it is written in pure Ruby (as opposed to wrapping an existing C library), you can use it without having to compile a separate extension. For more info, check out the website:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Write the RIFF chunk chunk header .
- Convert audio input string format
- Determine the top level channels .
- Closes the compressed file .
- Converts channels to different channels .
- Convert mappings to binary format
- Parses mappers
- Writes a stream .
- validate mappings
- Convert a type to a certain type .
wavefile Key Features
wavefile Examples and Code Snippets
Community Discussions
Trending Discussions on wavefile
QUESTION
I am trying to record an audio using AudioRecord on android and seperate the right and left channel recordings into two different files and then convert it to wav to be able to play on the phone.But the recorded files have fast speed and it has high pitch.
I read all the samples and wrote this code but I am not sure which part is causing the problem.
This is my AudioRecord definition.
...ANSWER
Answered 2021-Dec-21 at 18:43In the WAV-header you have 2 channels (stereo) output format:
writeShort(output, (short) 2); // number of channels
If so, then byterate should be 48000 * 4 (= 2 bytes per channel * 2 channels per sample) also the block alignment should be 4 for the same reason.
Also, you need to write each sample twice, because your output is stereo: once for each channel. E.g.:
QUESTION
I am using pyaudio to record sounds on my Mac BigSur 11.6 (20G165). Specifically, I'm redirecting sound from an application to the input using BlackHole, which works fine.
It usually works fine but, sometimes, I get this error in the Terminal:
||PaMacCore (AUHAL)|| Error on line 2500: err='-10863', msg=Audio Unit: cannot do in current context
Any idea why or how I could prevent it from happening (like, waiting until PaMacCore is ready to record again or something)?
I already tried reinstalling but it doesn't help
...ANSWER
Answered 2021-Nov-03 at 16:29Apparently the problem were mismatched bitrates in BlackHole's aggregated output device. I was aggregating Blackhole's output (44,1kHz) and the Mac Speakers (48kHz). This did not cause any consistent bad behaviour but sometimes led to these errors.
QUESTION
I have form class which receive the POST
request from web browswer.
ANSWER
Answered 2021-Nov-02 at 03:06form.save()
will return the instance, so:
QUESTION
ANSWER
Answered 2021-Aug-19 at 19:21By the two values you reported, it really does seem like soundfile.read
gave you a float64
array between -1 and 1 while wavfile.io.read
gave you a int32
array between -2147483648 and 2147483647 (-4850432/2147483648 = -0.00225866). You can make a normalized float_
array from either int_
or float_
array with the following:
QUESTION
I try to record my mic with pyaudio. So I use the example program:
...ANSWER
Answered 2021-Apr-12 at 12:34You can try to see whether you are using the right input device. Add the input_device_index={the right input device}
argument to the audio.open
.
You can check the ids of your devices like so: How to select a specific input device with PyAudio
QUESTION
I have been tying to setup xaudio2 and while I thought I succeeded, I quit the application while the sound is still playing and the program crashed. originally I made it so that when receiving a WM_CLOSE message I would make sure that the source voices had stopped. this drastically reduced the number of crashes, but still around 1/5 times I exit the application the program crashes. this is what it says "Exception thrown at 0x00007FF9974E38C7 (XAudio2_9.dll) in Game.exe: 0xC0000005: Access violation reading location 0x0000025274A680C4.". I am assuming that the xaudio2 thread is still trying to read the buffer even though I have disposed of it. I have set it up in a way so that there is a central SoundSystem class which has 2 vectors of Voices(another class), idleVoices and activeVoices. when I play a sound I grab a voice from the idle channels and play a sound, then when it is done I put it back in the idle channels and repeat.
here is the .h file
...ANSWER
Answered 2021-Mar-17 at 09:05You should add a call to StopEngine
in the WM_CLOSE
. This will stop all processing of the worker thread and likely resolve your crash.
You may want to take a look at DirectX Tool Kit for Audio.
QUESTION
I was coding a project and I came across a bug where QueryInterface()
was returning E_INVALIDARG
, I don't know which argument is invalid because both arguments are simple enough, am I overlooking something simple or what?
The bit that that is failing comes from Microsoft themselves specifically documentation, if I'm doing something totally wrong tell me
...ANSWER
Answered 2020-Dec-03 at 02:02There are only 2 parameters to QueryInterface()
for E_INVALIDARG
to complain about, and offhand they look fine to me inside of your CreateSecondaryBuffer()
function. The 1st parameter is being passed a hard-coded IID, so the problem has to be with the 2nd parameter, which expects to be passed a pointer to (in this case) an IDirectSoundBuffer8*
variable that QueryInterface()
can write the memory address of a DirectSoundBuffer8
object into. So most likely, the ppDsb8
parameter of your CreateSecondaryBuffer()
function is not being passed a valid pointer to a IDirectSoundBuffer8*
variable, like you are expecting.
UPDATE: After seeing your added comment, you are indeed passing an invalid pointer to the ppDsb8
parameter of CreateSecondaryBuffer()
. The caller's pMainSecondaryBuffer
pointer is being declared incorrectly, and is uninitialized when passed to CreateSecondaryBuffer()
, so you are passing a bad pointer to QueryInterface()
, hence the E_INVALIDARG
error.
Use this instead:
QUESTION
I am trying to play a wav file using AudioContext - it plays correctly when loaded with tag (as shown in jsfiddle), but plays incorrectly when using AudioContext.
ANSWER
Answered 2020-Sep-28 at 11:23The decodeAudioData()
function of the Web Audio API can decode WAV files which is why you don't need any external libraries for this use case. It will produce an AudioBuffer
for you.
QUESTION
I am running a main script on windows 10 that calls another script called audioplayer.py using the subprocess
module in python.
I want to send some input arguments when calling the audioplayer.py. So I wrote the main script as follows:
The following is the main script:
...ANSWER
Answered 2020-Aug-19 at 00:41try this:
QUESTION
I am trying to get a bit of code that I found online to work with the usage examples given in the README.md file. The intention of the tools are to synthesize an audio scene out of separate events.I cannot figure out how to run the usage examples given, which are:
...ANSWER
Answered 2020-Aug-04 at 21:54It's probably asking you to run the file with the python interpreter, i.e. if you are in the directory,
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install wavefile
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page