Reply
Thread Tools
Posts: 455 | Thanked: 278 times | Joined on Dec 2009 @ Oregon, USA
#1
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?
 

The Following 2 Users Say Thank You to craftyguy For This Useful Post:
pycage's Avatar
Posts: 3,404 | Thanked: 4,474 times | Joined on Oct 2005 @ Germany
#2
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.
__________________
Tidings - RSS and Podcast aggregator for Jolla - https://github.com/pycage/tidings
Cargo Dock - file/cloud manager for Jolla - https://github.com/pycage/cargodock
 

The Following User Says Thank You to pycage For This Useful Post:
Posts: 1,048 | Thanked: 979 times | Joined on Mar 2008 @ SF Bay Area
#3
Originally Posted by craftyguy View Post
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?
I've been researching this a bit, and I have only very vague hints (QT specific):
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.
__________________
qgvdial: Google Voice client. All downloads
qgvtp: Phone integration for the n900 that dials out and sends texts using qgvdial.
mosquitto: message broker that implements the MQ Telemetry Transport protocol version 3.
qgvnotify: Google voice and contacts notifier for diablo and maemo.

If you want to thank me, click the Thanks button.
If you'd like to thank my applications, vote to move them to extras.
 

The Following User Says Thank You to uvatbc For This Useful Post:
Posts: 455 | Thanked: 278 times | Joined on Dec 2009 @ Oregon, USA
#4
I've never used QT before, but a quick look at the documentation reveals this:

QList<QString> QAudioEndpointSelector::availableEndpoints () const [pure virtual]

Returns a list of available audio endpoints.
Could this be used to get a list of all possible endpoints, so it would be easier to figure out what the proper endpoint is for the handset speaker?
 

The Following User Says Thank You to craftyguy For This Useful Post:
pelago's Avatar
Posts: 2,121 | Thanked: 1,540 times | Joined on Mar 2008 @ Oxford, UK
#5
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?
 
Posts: 455 | Thanked: 278 times | Joined on Dec 2009 @ Oregon, USA
#6
Originally Posted by pelago View Post
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?
My idea is to make it work for one app. If I can figure it out, I would have absolutely no problem with sharing the solution with others so that they may implement it in their applications
 

The Following User Says Thank You to craftyguy For This Useful Post:
Posts: 1,048 | Thanked: 979 times | Joined on Mar 2008 @ SF Bay Area
#7
Originally Posted by craftyguy View Post
I've never used QT before, but a quick look at the documentation reveals this:

Could this be used to get a list of all possible endpoints, so it would be easier to figure out what the proper endpoint is for the handset speaker?
That function will give you a list of the available endpoints, and then void setActiveEndpoint ( const QString & name ) will select one for you.

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.
__________________
qgvdial: Google Voice client. All downloads
qgvtp: Phone integration for the n900 that dials out and sends texts using qgvdial.
mosquitto: message broker that implements the MQ Telemetry Transport protocol version 3.
qgvnotify: Google voice and contacts notifier for diablo and maemo.

If you want to thank me, click the Thanks button.
If you'd like to thank my applications, vote to move them to extras.
 

The Following User Says Thank You to uvatbc For This Useful Post:
RafaLL92's Avatar
Posts: 116 | Thanked: 77 times | Joined on Jan 2010
#8
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?
 
Posts: 1,048 | Thanked: 979 times | Joined on Mar 2008 @ SF Bay Area
#9
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.
__________________
qgvdial: Google Voice client. All downloads
qgvtp: Phone integration for the n900 that dials out and sends texts using qgvdial.
mosquitto: message broker that implements the MQ Telemetry Transport protocol version 3.
qgvnotify: Google voice and contacts notifier for diablo and maemo.

If you want to thank me, click the Thanks button.
If you'd like to thank my applications, vote to move them to extras.
 

The Following User Says Thank You to uvatbc For This Useful Post:
Posts: 1,086 | Thanked: 2,964 times | Joined on Jan 2010
#10
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?
__________________
Follow me on my neglected twitter @kojacker

Cybot950 - Control a robot with your N9/N950
SMSPetFeeder - Build a Bluetooth/SMS dog feeder with Qt, N950, and arduino
Nerf950 - Use your N9/N950 to fire a Nerf gun
 
Reply


 
Forum Jump


All times are GMT. The time now is 02:45.