libalsa

ALSA sequencer: Avoid input buffer overrun with High-Speed MIDI

扶醉桌前 提交于 2021-02-11 14:39:44
问题 I want to send large SysEx messages (which can be several Megabytes) through the ALSA sequencer: Currently I split them into several ALSA events and send each of them in a loop like that: while (1) { result = snd_seq_event_output_direct( seq, const_cast<snd_seq_event_t*>(&ev) ); if (result != -EAGAIN && result != -EWOULDBLOCK) break; snd_seq_sync_output_queue( seq ); //std::this_thread::sleep_for(sleeptime); } This loop ensures that all events get sent from the sending client/port. But as

ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) Invalid value for card arecord: main:722: audio open error: No such file or directory

ぐ巨炮叔叔 提交于 2020-01-24 08:36:30
问题 i am working on speech recognition . for this i am using "alsa-utils" but when i try to use this script #!/bin/bash echo “Recording… Press Ctrl+C to Stop.” arecord -D plughw:1,0 -q -f cd -t wav | ffmpeg -loglevel panic -y -i – -ar 16000 -acodec flac file.flac > /dev/null 2>&1 echo “Processing…” wget -q -U “Mozilla/5.0” –post-file file.flac –header “Content-Type: audio/x-flac; rate=16000” -O – “http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium” | cut -d” -f12 >stt.txt

ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) Invalid value for card arecord: main:722: audio open error: No such file or directory

为君一笑 提交于 2020-01-24 08:36:12
问题 i am working on speech recognition . for this i am using "alsa-utils" but when i try to use this script #!/bin/bash echo “Recording… Press Ctrl+C to Stop.” arecord -D plughw:1,0 -q -f cd -t wav | ffmpeg -loglevel panic -y -i – -ar 16000 -acodec flac file.flac > /dev/null 2>&1 echo “Processing…” wget -q -U “Mozilla/5.0” –post-file file.flac –header “Content-Type: audio/x-flac; rate=16000” -O – “http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium” | cut -d” -f12 >stt.txt

aplay piping to arecord using a file instead of stdin and stdout

人盡茶涼 提交于 2019-12-14 03:06:22
问题 Below command will record the data from default device and output it on stdout and aplay will play the data from stdin. arecord -D hw:0 | aplay -D hw:1 - Why we prefer stdin and stdout instead of writing into a file and reading from it as below? arecord -D hw:0 test.wav | aplay -D hw:1 test.wav 回答1: Using a pipe for this operation is more efficient and effective than using a file, simply because of the following reasons: 1) Pipe (|) is an interprocess communication technique. The output of