2

My Raspberry Pi 3 is going to be used like a music center, it will play various songs and videos but recently I want to implement a "voice amplifier" command or software, I tried to find on Google similar topics but only found related topics like streaming audio from one Pi to another or a baby monitor...

TL;DR-> Basically outputting anything that my microphone hears through jack port.

My setup is

  • RPI 3B 1.2ghz w/ Raspbian Jessie OS March update
  • Blue Snowball iCE USB microphone
  • Old but awesome big Pioneer speakers (Connects through Jack)
-1

Try to use alsaaudio

Here is an exemple(Not sure if it work):

import alsaaudio, audioop

micro = alsaaudio.PCM(alsaaudio.PCM_CAPTURE,card='hw:1,0')#Microphone
micro.setchannels(1)
micro.setrate(10) #10
micro.setformat(alsaaudio.PCM_FORMAT_S8)
micro.setperiodsize(32) # 32

output = alsaaudio.PCM(mode=alsaaudio.PCM_ASYNC , card='hw:1,0')#Speakers
output.setchannels(1)
output.setrate(100)
output.setformat(alsaaudio.PCM_FORMAT_S8)
output.setperiodsize(320)

while True:
    sample_length, sample = micro.read()
    sortie.write(sample)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.