Recording at 8 kHZ mono

Moderator: flatmax

Post Reply
flatmax
Posts: 609
Joined: Sat Jul 23, 2016 11:39 pm

Recording at 8 kHZ mono

Post by flatmax » Sat Nov 12, 2016 6:52 pm

Some people would like to record at 8 kHz sample rates.
To do this use the following command :

Code: Select all

arecord -D"plug:'dsnoop:RATE=8000'" /tmp/test.wav
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector

namdoog
Posts: 5
Joined: Tue Jan 31, 2017 9:55 am

Re: Recording at 8 kHZ mono

Post by namdoog » Tue Feb 14, 2017 10:30 am

flatmax wrote:Some people would like to record at 8 kHz sample rates.
To do this use the following command :

Code: Select all

arecord -D"plug:'dsnoop:RATE=8000'" /tmp/test.wav
Just curious: This also seems to work:

Code: Select all

arecord -r 8000 -f S16_LE -c 2 /tmp/test.wav
(Modelled after the arecord command in your test script.)

Is the result different? What does the dsnoop device selection do for us here? (Forgive the newbie inquiry).

flatmax
Posts: 609
Joined: Sat Jul 23, 2016 11:39 pm

Re: Recording at 8 kHZ mono

Post by flatmax » Tue Feb 21, 2017 5:51 am

Hi there,

Since updaing the driver, I have enabled the hardware to record natively at 8000 Hz. Previously (before enabling) we had to use the ALSA dsnoop plugin to resample for us.
Thanks for pointing out this upgrade !

Matt
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector

brett
Posts: 9
Joined: Wed Mar 22, 2017 10:44 pm

Re: Recording at 8 kHZ mono

Post by brett » Wed Mar 22, 2017 11:14 pm

Hi not sure what im doing wrong. i have a raspberry pi3 with the latest jessie, do i need a modified asoundrc file, or have i messed up the alsamixer settings




pi@raspberrypi:~ $ arecord -D"plug:'dsnoop:RATE=8000'" /tmp/ttest.wav
ALSA lib pcm_direct.c:896:(snd1_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access
ALSA lib pcm_dsnoop.c:629:(snd_pcm_dsnoop_open) unable to initialize slave
arecord: main:722: audio open error: Invalid argument


thank-you

brett
Posts: 9
Joined: Wed Mar 22, 2017 10:44 pm

Re: Recording at 8 kHZ mono

Post by brett » Thu Mar 23, 2017 1:32 pm

hi i tried another sd card i had with all the pulseaudio removed, it worked with your... arecord -D"plug:'dsnoop:RATE=8000'" /tmp/test.wav. Is there a way that the asoundrc file, could be written to do this automaticaly , I am trying to get pocketsphinx to work it doesnt like dsnoop , as it wont do 8000khz any hlp would be appreiciated.

flatmax
Posts: 609
Joined: Sat Jul 23, 2016 11:39 pm

Re: Recording at 8 kHZ mono

Post by flatmax » Fri Mar 24, 2017 10:27 pm

Hey there,

I think I have an idea for you to record 8 kHZ mono. The dsnoop plug does everything and I am not sure if there is extra cost involved. MY idea is to use an .asoundrc file in your home directory to redefine the default device to let you do either stereo or mono.

I have only tested this for playback, could you test it with recording ? It is setup to automatically use the standard sound card (assuming your audioinjector card is card 0). Also the latest audioinjector stereo Pi card supports 8 kHZ natively.

With the .asoundrc file below :
This should work : aplay monoTrack.wav
This should work : aplay stereoTrack.wav

I haven't tested recording... can you let me know if it works ?

Code: Select all

pcm.!default 1or2ch

ctl.!default {
	type hw
	card 0
}

pcm.1or2ch {
	  type route
	  slave.pcm "hw:0"
	  slave.channels 2
	  ttable.0.0 1
	  ttable.1.1 1
}
thanks
Matt
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector

brett
Posts: 9
Joined: Wed Mar 22, 2017 10:44 pm

Re: Recording at 8 kHZ mono

Post by brett » Sun Mar 26, 2017 9:28 pm

Thankyou for your help, i did not need the asoundrc, i ended up leaving my asoundrc blank, and the card started to work, how i wanted it too, thank-you again

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests