• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1875
  • Last Modified:

How to convert a 'mono' signal to a 'stereo' signal?

Hey,

      I'm trying to write a program to convert a 'mono' signal to a 'stereo' signal.  I was just wondering what the simplest way to get this done was.

I was hoping to do it in Python, but I would be open to doing it in an other language as well.

Could anyone point me to any tutorials or sample code that could get me started?

Appreciate any help on this!
0
errang
Asked:
errang
  • 3
  • 2
  • 2
  • +1
2 Solutions
 
Neil RussellTechnical Development LeadCommented:
You can not simply "Convert" a mono input to a stereo output.  The mono signal does not contain any information to "Make" it stereo.
0
 
errangAuthor Commented:
Yea, I was wondering if there were any library functions that helped with it.  Rather than manually converting the signal myself.
0
 
gelonidaCommented:
What is your exact intention and what file format are you talking about.

Do you wan to convert a file with only one audio channel into a file with two identical audio channels or do you look for a smart algorithm trying to add some stereo effect?

What file format do you talk about .mp3 / .wav  raw audio format ???

On the command line sox is one of the commands allowing to convert audio file formats but there are many others.

Depening on your needs and your platform (Windows? Linux?)  you can either use python to call one of these scripts or you could install a python library to perform this task.

A few more details will help us to give a better answer.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
errangAuthor Commented:
>>Do you wan to convert a file with only one audio channel into a file with two identical audio >>channels or do you look for a smart algorithm trying to add some stereo effect?

>>What file format do you talk about .mp3 / .wav  raw audio format ???

I'm trying to convert a .wav file.  I can't attach the file here because it isn't one of the supported file types.  I'm just trying to produce a file with a stereo signal, I'm guessing something that would change the frequency or changing the phase of the signal would do the trick, right?

>>Depening on your needs and your platform (Windows? Linux?)  you can either use python to call one of these scripts or you could install a python library to perform this task.

I'm running this program on a Macintosh at the moment.
0
 
Dave BaldwinFixer of ProblemsCommented:
Use Audacity to do your audio editing.  http://audacity.sourceforge.net/  Standard practice is to take the mono signal and put a copy of it on both the left and right channels.
0
 
errangAuthor Commented:
>>Use Audacity to do your audio editing.  http://audacity.sourceforge.net/  Standard practice is to take the mono signal and put a copy of it on both the left and right channels.

That's not an API, is it? I need to write a program to do that.
0
 
Dave BaldwinFixer of ProblemsCommented:
Then here is some info about WAV file formats:  http://en.wikipedia.org/wiki/WAV  You have to know what bitrate and codec you need to use along with how to construct the headers.  The links at the bottom of the article will have more info.
0
 
gelonidaCommented:
sox is a command line tool if you can compile / install it, you can control it via a python script.

you could use it for example to convert the wav file to a raw audio file, read it in with python, modify values and then with sox  convert the raw format back to wav
What I still don't understand:
Why do you want to create a stereo signal.
Do you want to have a file, that is 'technically speaking' steroe, but has the same signal on the left or on the right side or do you really need different values on the left and right channel.

If yes, for what reason. There's many operations you can do but The reason is why you want to do these operations.

Do you want an audible difference or is just toggling the least significatn bit of one channel enough?
Would a phase shift be enough, or just changing the volume of one channel?

It all depends on the motiviation behind your question.


Python has also a wav module, but it depends on the exact format of the wav file (compression on or off etc. whether the module will be able to read it)

http://docs.python.org/library/wave.html
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now