The Following User Says Thank You to helex For This Useful Post: | ||
![]() |
2010-05-25
, 20:01
|
|
Posts: 1,366 |
Thanked: 1,185 times |
Joined on Jan 2006
|
#2
|
The Following User Says Thank You to mikec For This Useful Post: | ||
![]() |
2010-05-25
, 20:12
|
|
Posts: 543 |
Thanked: 802 times |
Joined on Apr 2010
@ Germany
|
#3
|
If you are using PR1.2 then the QtMultimedia stuff is what you need.
see the blog
http://labs.trolltech.com/blogs/2010...trum-analyser/
![]() |
2010-05-27
, 16:05
|
|
Posts: 543 |
Thanked: 802 times |
Joined on Apr 2010
@ Germany
|
#4
|
ALSA lib pcm.c:2211: (snd_pcm_open_noupdate) Unknown PCM null
from PyQt4 import QtMultimedia devi = QtMultimedia.QAudioDeviceInfo.availableDevices(QtMultimedia.QAudio.AudioInput) for d in devi: d.deviceName() devo = QtMultimedia.QAudioDeviceInfo.availableDevices(QtMultimedia.QAudio.AudioOutput) for do in devo: do.deviceName() info = QtMultimedia.QAudioDeviceInfo(QtMultimedia.QAudioDeviceInfo.defaultInputDevice()) print info.deviceName()
![]() |
2010-05-27
, 18:57
|
|
Posts: 1,366 |
Thanked: 1,185 times |
Joined on Jan 2006
|
#5
|
![]() |
2010-05-27
, 21:48
|
|
Posts: 543 |
Thanked: 802 times |
Joined on Apr 2010
@ Germany
|
#6
|
I have not used it yet, but will do soon. Did you have a look at the multimedia example
http://doc.qt.nokia.com/4.6/examples-multimedia.html
And the ref python doc
http://www.riverbankcomputing.co.uk/...a.html#details
from PyQt4 import QtMultimedia from PyQt4.QtCore import * file = QFile() file.setFileName("testMicIn.wav") file.open(QIODevice.WriteOnly) format = QtMultimedia.QAudioFormat() format.setFrequency(8000) format.setChannels(1) format.setCodec("audio/pcm") format.setByteOrder(QtMultimedia.QAudioFormat.LittleEndian) format.setSampleType(QtMultimedia.QAudioFormat.UnSignedInt) info = QtMultimedia.QAudioDeviceInfo(QtMultimedia.QAudioDeviceInfo.defaultInputDevice()) print "-" devi = QtMultimedia.QAudioDeviceInfo.availableDevices(QtMultimedia.QAudio.AudioInput) for d in devi: d.deviceName() devo = QtMultimedia.QAudioDeviceInfo.availableDevices(QtMultimedia.QAudio.AudioOutput) for do in devo: do.deviceName() print "-" print info.deviceName() print info.isFormatSupported(format) format = info.nearestFormat(format) print info.isFormatSupported(format) audio = QtMultimedia.QAudioInput(format, None) audio.start(file) audio.stop() file.close() del audio
![]() |
2010-05-29
, 22:41
|
Posts: 3 |
Thanked: 5 times |
Joined on Nov 2009
|
#7
|
The Following User Says Thank You to gavinmitchell For This Useful Post: | ||
![]() |
2010-06-01
, 23:44
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#8
|
The Following User Says Thank You to noobmonkey For This Useful Post: | ||
![]() |
2010-06-02
, 07:28
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#9
|
The Following User Says Thank You to noobmonkey For This Useful Post: | ||
![]() |
2010-06-02
, 07:38
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#10
|
The Following User Says Thank You to noobmonkey For This Useful Post: | ||
In my opinion I have now a great Idea for a application to learn and contribute to the first N900 coding competition.
Yes, it will be great! But I don't want to share my Idea now... (Apple could steal it before I finished it)
It's a lot of work to do. So I will begin soon to finish before the deadline. I finished the script and some mockups for the UI, I know how to store in a Database, how to read binary files... I guess I can figure out how to draw images on the screen, store them on mmc1 and to see if the battery is charging. No problems so far for my, only work... except one of the core elements I don't know how to solve...
Without that the application is useless. So, I hope here is someone who can help me to finish my (top secret) project in PyQt4:
I need to read every 100ms the volume peak, the average input level or the maximum input level or something similar from the microphone. I don't want to record the stream or something else... just: noise out there, 20% of 100% maximum peak or 80%? A simple integer value how loud the environment is.
Are there someone out there who could show me the way?
I looked into the code of Tuner, but its to much for my needs and C++.
Is portaudio19-dev useful for me?
So please help so that I can start with my project!