JMF: play MP3 in Mono

M

mungoh

Hi,
I'm using Java Media Framework to play MP3s. The target location
hasn't got a Stereo output that
feeds the power amplifiers (its just Mono) and all we hear is the Left
track.
Any cute and neat method to ask the JMF realizedPlayer to combine the
stereo outputs and generate Mono rather
than me having to use Audacity to split-then-merge each track (a large
job, but one that I may get resigned
to doing if there isn't a software fix)?
Thanks in advance

Mungo (java newbie - please be gentle! :)
 
O

Oliver Wong

Hi,
I'm using Java Media Framework to play MP3s. The target location
hasn't got a Stereo output that
feeds the power amplifiers (its just Mono) and all we hear is the Left
track.
Any cute and neat method to ask the JMF realizedPlayer to combine the
stereo outputs and generate Mono rather
than me having to use Audacity to split-then-merge each track (a large
job, but one that I may get resigned
to doing if there isn't a software fix)?
Thanks in advance

Did you try using the JavaSound API to try to pan all the sound to the
left channel?

- Oliver
 
M

mungoh

Did you try using the JavaSound API to try to pan all the sound to the
left channel?

- Oliver



Nope. I got scared of JavaSound and chickened out and used JMF. The
interface I need is simply a way
of taking a pathname to a file and then playing this out the speakers
- JMF could achieve this with
a few lines of code hence it seemed daft to descend to a lower
interface level (albeit one with more
control) when I didn't (initially) need that sophistication.
But if you say I need to go lower, perhaps that's the only way.

Ta for the pointer Oliver.

Regards

Mungo
 
O

Oliver Wong

Nope. I got scared of JavaSound and chickened out and used JMF. The
interface I need is simply a way
of taking a pathname to a file and then playing this out the speakers
- JMF could achieve this with
a few lines of code hence it seemed daft to descend to a lower
interface level (albeit one with more
control) when I didn't (initially) need that sophistication.
But if you say I need to go lower, perhaps that's the only way.

I'm not very familiar with JMF, but it looks like there's many ways to
do this. The panning trick is simply the first one that popped into my
head. http://java.sun.com/docs/books/tutorial/sound/converters.html seems
to indicate that it may also possible to directly convert between various
AudioFormats (e.g. from a stereo format to a mono one), and
http://java.sun.com/docs/books/tutorial/sound/controls.html mentions that
you can directly manipulate audio data (which is VERY low level).

I couldn't find many JMF specific tutorials that covered manipulating
the sound signal (and thus allowing you to alter panning).

- Oliver
 
A

Andreas Leitgeb

Any cute and neat method to ask the JMF realizedPlayer to combine the
stereo outputs and generate Mono

I'd rather suggest a hardware solution:
some stereo->mono converter that mixes the
channels on the analogue side of the audio
stream.

If that is not an option, the keyword to look
for is "Processor". You'd implement a Processor
object that mono'ifies the audio, and can feed
the data to an already existing Player.
(I'm not a JMF expert either - I just googled
for Java media framework, clicked the first
hit, and skimmed a bit through sun's guide to
jmf)
 
M

mungoh

I'd rather suggest a hardware solution:
some stereo->mono converter that mixes the
channels on the analogue side of the audio
stream.

If that is not an option, the keyword to look
for is "Processor". You'd implement a Processor
object that mono'ifies the audio, and can feed
the data to an already existing Player.
(I'm not a JMF expert either - I just googled
for Java media framework, clicked the first
hit, and skimmed a bit through sun's guide to
jmf)



Many thanks Andreas - I did some Googling before I posted my query but
I am not that familiar with
this area (like, enough to make me dangerous :) so it was worth the
post to prod someone that has
more domain experience to point me in the right direction.

Thanks for your help.

Mungo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top