Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

JMF: play MP3 in Mono

Thread view: 
mungoh@gmail.com - 26 Mar 2007 21:49 GMT
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! :-)
Oliver Wong - 26 Mar 2007 22:25 GMT
> Hi,
> I'm using Java Media Framework to play MP3s. The target location
[quoted text clipped - 7 lines]
> 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
mungoh@gmail.com - 26 Mar 2007 23:31 GMT
>     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
Oliver Wong - 27 Mar 2007 00:05 GMT
>>     Did you try using the JavaSound API to try to pan all the sound to
>> the
[quoted text clipped - 8 lines]
> 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
mungoh@gmail.com - 27 Mar 2007 07:51 GMT
[big snip]
>     - Oliver

Many thanks for the help Oliver: I will digest this over the next day
or so and tackle the problem
from a different angle!
Much obliged.

Regards

Mungo :-)
Andreas Leitgeb - 27 Mar 2007 08:39 GMT
> 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)
mungoh@gmail.com - 27 Mar 2007 17:53 GMT
On 27 Mar, 08:39, Andreas Leitgeb <a...@gamma.logic.tuwien.ac.at>
wrote:
> mun...@gmail.com <mun...@gmail.com> wrote:
> > Any cute and neat method to ask the JMF realizedPlayer to combine the
[quoted text clipped - 13 lines]
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.