Vote count:
0
I am trying to stream audio from a microphone using python, specifically the PySoundCard Package. My code so for is:
import wave
from pysoundcard import Stream
from pysoundfile import SoundFile, ogg_file, write_mode
def getAudStreaming():
with Stream as s:
SF = SoundFile('new_audio_file_1.wav',
sample_rate=s.sample_rate,
channels=s.input_channels,
format=ogg_file,
mode=write_mode)
SF.write(s.read(s.sample_rate))
I believe that this is, so far, correct. I would like to
- sample at 8 kHz,
- frame the signal into 256 samples,
- calculate energy of each sample
- store these samples into an array,
- and store the signal into the computer's memory.
I have only been using python for a few days, so this stuff is a bit difficult for me. Would anyone care to explain how I could implement these steps? I have an idea of how I should do it, but get jumbled up in the syntax. Thanks!
asked 21 secs ago
Aucun commentaire:
Enregistrer un commentaire