![]() |
how to output audio to phone speaker? (N900)
I'm considering developing an application, and one feature is to output audio over the phone speaker that you hear when you hold the N900 up to your ear (like when on the phone). I cannot find any information in the developer guide posted in the wiki. Is this possible?
|
Re: how to output audio to phone speaker? (N900)
Some mixer settings make this possible but I don't remember the details.
Play with the switches in alsamixer -c0 until you get it to play over the ear piece. |
Re: how to output audio to phone speaker? (N900)
Quote:
If you're using a QMediaPlayer object then by using QMediaPlayer::service() to get a QMediaService and then QMediaService::control(QAudioEndpointSelector_iid) to get a QAudioEndpointSelector, you should be able to select the audio output. I haven't yet figured out what iid to pass to the service() function. This is all theoretical so far, so if you do manage, please let me know as well. |
Re: how to output audio to phone speaker? (N900)
I've never used QT before, but a quick look at the documentation reveals this:
Quote:
|
Re: how to output audio to phone speaker? (N900)
Good luck with this. I've sometimes wanted to listen to audio from Media Player or the web (e.g. web-based voicemail messages, or voicemail messages that come as email attachments) in private without having to use headphones, so if you can make this work that would be helpful. Or are you only thinking about trying to make this work for one app, rather than system-wide?
|
Re: how to output audio to phone speaker? (N900)
Quote:
|
Re: how to output audio to phone speaker? (N900)
Quote:
The problem is that QAudioEndpointSelector does not have a public constructor. This means that it is not supposed to be constructed by us on stack or heap - some factory class or API will return us an object or a derived class object. It might even be that we (as devs) are supposed to derive and instantiate it, but, in this particular context I can't see how that makes sense. The only thing that makes sense right now is the usage of QAudioEndpointSelector_iid to get to an object - which was the thrust of my previous comment. |
Re: how to output audio to phone speaker? (N900)
That would be great if it could be implemented at least to the built-in media player!
Forgetting the headphones could be overcome to some extent :) Whats the status? Is the 'project' dead? |
Re: how to output audio to phone speaker? (N900)
It's not a project - OP asked a development question regarding redirection of audio output.
I have tried a few bits of code, but so far I have only been able to easily change audio input source, not audio output. I think I'll have to look at pulseaudio to see if there is an API to do what OP and I need. |
Re: how to output audio to phone speaker? (N900)
Just wondering was this ever solved? I'm researching for a way to change the audio output to the ear piece speaker and came across this thread. Anyone get it working?
|
Re: how to output audio to phone speaker? (N900)
Quote:
Hopefully you can figure out a way :) |
Re: how to output audio to phone speaker? (N900)
A possible work around would be to go to this file.
/var/lib/pulse-nokia/ihf.parameters Look through the file with a text editor untill you see this line: x-maemo.alsa_sink.mixer_control = "HP DAC: control,Headphone:off,Earphone: off" And change it to: x-maemo.alsa_sink.mixer_control = "HP DAC: off,Headphone: off,Earphone: control" And restart pulse audio daemon, I know it's not practical for a program but it's still worth a look. Edit: On second thought forget it...I think it's too risky. |
Re: how to output audio to phone speaker? (N900)
I'm responding to this thread which is about 2 months old, but hopefully the interested members are still subscribed.
I'm back to bashing my head against this particular wall and came up with the following links which may be useful: http://pulseaudio.org/wiki/Developer...elopingClients http://pulseaudio.org/wiki/SampleAsyncDeviceList http://pulseaudio.org/wiki/DBusInterface I was thinking along the lines of: 1. Use PA api to enumerate all clients (including me) 2. Use PA api to enumerate the various audio sinks 3. Change my client's sink to the user specified sink. |
Re: how to output audio to phone speaker? (N900)
Wow thanks for digging into this a bit more! Hopefully I will get a chance to take a look in the next week or two.
|
Re: how to output audio to phone speaker? (N900)
I am trying to do the same for my app using qt and pulseaudio.
You can find the audio devices from the command line: [ Quote:
I believe there is some kind of policy in pulseaudio: Have a look on Quote:
|
| All times are GMT. The time now is 22:14. |
vBulletin® Version 3.8.8