-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
7. Audio Recording Functionalities
tyiannak edited this page Aug 10, 2016
·
2 revisions
Some basic recording functionalities are supported and demonstrated in audioAnalysisRecordAlsa.py. However, this requires the alsa-audio python library, only available in Linux, (sudo apt-get install python-alsaaudio)
Function recordAudioSegments(RecordPath, BLOCKSIZE) from the audioAnalysisRecordAlsa.py file records successive fix-sized segments and stores them to the RecordPath folder.
Command-line use example:
python audioAnalysisRecordAlsa.py -recordSegments "rSpeech" 2.0
Function recordAnalyzeAudio(duration, outputWavFile, midTermBufferSizeSec, modelName, modelType) from the audioAnalysisRecordAlsa.py file records audio data and classifies each fix-sized segment (size midTermBufferSizeSec) using classifier modelName.
Command-line use example
python audioAnalysisRecordAlsa.py -recordAndClassifySegments 20 out.wav knnRecNoiseActivity knn
pyAudioAnalysis - Theodoros Giannakopoulos