How to read from audio device and write to .wav file?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mihai Giurca
el 30 de En. de 2021
Respondida: Walter Roberson
el 31 de En. de 2021
I was wondering if it is possible to record audio from your speakers/headset and save it to a .wav file? I was able to write a program that records audio from your microphone and saves it but I am a little stuck on how to capture the audio from something like a youtube video and save it. Any ideas? This is the code I have at the moment and it works great but I want to record the audio output instead of recording my audio input (mic).
deviceReader = audioDeviceReader;
setup(deviceReader);
fileWriter = dsp.AudioFileWriter('test.wav', 'FileFormat', 'WAV');
tic
while toc < 10
aquiredAudio = deviceReader();
fileWriter(aquiredAudio);
end
release(deviceReader);
release(fileWriter);
0 comentarios
Respuesta aceptada
Walter Roberson
el 31 de En. de 2021
On Windows, you need a special device driver for that, and it is incompatible with directsound . See https://www.mathworks.com/matlabcentral/answers/386734-how-do-i-get-sound-data-from-a-speaker#answer_309137
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Audio I/O and Waveform Generation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!