Pure Tones in C# How do I produce? 
Author Message
 Pure Tones in C# How do I produce?

I posted this in the .framework newsgroup a couple of days ago and did not
get any type of response so I thought that I would post it here.

I need to produce some tones at various frequencies such as 250 - 6000
kilohertz.

I need to produce these tones for both the left and right channels at the
same time and then produce them seperatly for the left channel and then for
the right channel.

I know that there is no built in support for this in C# (at least that I
could find) and was wondering if anyone has any dirty code and or ideas on
how I could produce these tones using C# and .net.

Any help would be greatly appreciated.



Mon, 17 Jan 2005 05:35:05 GMT  
 Pure Tones in C# How do I produce?
If you can produce .WAV or .MID(I) files
for this tones, and timing no issue, try:
WaveFile
  http://www.allapi.net/classlib/class.php?id=8
MidiFile
  http://www.allapi.net/classlib/class.php?id=19

else I guess you have to search pure C++/win32 code first,
then port it yourself to C# using PInvoke.
E.g. low-level C++ sample (using waveOutWrite)
  http://www.codeproject.com/audio/lamer2000.asp

Note you could use stereo files and
control the volume of left/right channel...

--
  NETMaster  (Thomas Scheidegger)
  http://www.cetus-links.org/oo_csharp.html

Quote:

> I posted this in the .framework newsgroup a couple of days ago and did not
> get any type of response so I thought that I would post it here.
> I need to produce some tones at various frequencies such as 250 - 6000
> kilohertz.
> I need to produce these tones for both the left and right channels at the
> same time and then produce them seperatly for the left channel and then for
> the right channel.
> I know that there is no built in support for this in C# (at least that I
> could find) and was wondering if anyone has any dirty code and or ideas on
> how I could produce these tones using C# and .net.



Mon, 17 Jan 2005 17:21:38 GMT  
 Pure Tones in C# How do I produce?
Unfortunatly a wave file wont really work because I need to produce the tone
for various lengths and I would have to produce too many .wav files.

Do you know of any  pure C++/win32 libraries.. or where I might start to
look to do this?


Quote:
> If you can produce .WAV or .MID(I) files
> for this tones, and timing no issue, try:
> WaveFile
>   http://www.allapi.net/classlib/class.php?id=8
> MidiFile
>   http://www.allapi.net/classlib/class.php?id=19

> else I guess you have to search pure C++/win32 code first,
> then port it yourself to C# using PInvoke.
> E.g. low-level C++ sample (using waveOutWrite)
>   http://www.codeproject.com/audio/lamer2000.asp

> Note you could use stereo files and
> control the volume of left/right channel...

> --
>   NETMaster  (Thomas Scheidegger)
>   http://www.cetus-links.org/oo_csharp.html




- Show quoted text -

Quote:
> > I posted this in the .framework newsgroup a couple of days ago and did
not
> > get any type of response so I thought that I would post it here.
> > I need to produce some tones at various frequencies such as 250 - 6000
> > kilohertz.
> > I need to produce these tones for both the left and right channels at
the
> > same time and then produce them seperatly for the left channel and then
for
> > the right channel.
> > I know that there is no built in support for this in C# (at least that I
> > could find) and was wondering if anyone has any dirty code and or ideas
on
> > how I could produce these tones using C# and .net.



Mon, 17 Jan 2005 17:44:12 GMT  
 Pure Tones in C# How do I produce?
Thomas..
I just noticed the other link to the morse code program.. That may do the
trick!  I am checking it out now.. not quite sure how to move it to C#
though..
Quote:
> > else I guess you have to search pure C++/win32 code first,
> > then port it yourself to C# using PInvoke.
> > E.g. low-level C++ sample (using waveOutWrite)
> >   http://www.codeproject.com/audio/lamer2000.asp



Mon, 17 Jan 2005 17:58:18 GMT  
 Pure Tones in C# How do I produce?
Thomas  Ya this would work perfectly.. however I am new to C# let alone C++
this is the most cryptic stuff I have seen in quite a while.. it is going to
take some serious work to figure it out.  Have you ever converted something
like this to C#?  Has anyone else?  Where do I start?  Any pointers/hints
would be helpful..

Thanks again for your help


Quote:
> Thomas..
> I just noticed the other link to the morse code program.. That may do the
> trick!  I am checking it out now.. not quite sure how to move it to C#
> though..

> > > else I guess you have to search pure C++/win32 code first,
> > > then port it yourself to C# using PInvoke.
> > > E.g. low-level C++ sample (using waveOutWrite)
> > >   http://www.codeproject.com/audio/lamer2000.asp



Mon, 17 Jan 2005 18:20:29 GMT  
 Pure Tones in C# How do I produce?
You have to use PInvoke exactly like
  http://www.allapi.net/classlib/class.php?id=8
 [WaveFile.cs, e.g. waveOutWrite() ]

--
  NETMaster  (Thomas Scheidegger)
  http://www.cetus-links.org/oo_csharp.html

Quote:

> I just noticed the other link to the morse code program.. That may do the
> trick!  I am checking it out now.. not quite sure how to move it to C#
> though..



Mon, 17 Jan 2005 18:31:03 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Generating Tones in C# - Is there a way?

2. Pure Virtual Functions in C#

3. Does C# produce .exe files?

4. C# produces better IL than C++

5. Native x86 code produced by C# is terribly infficient

6. What is the common methjod of doing this in C#

7. can this be done using C# in .NET?

8. phone tones i nvisual c++

9. Need command to generate a tone

10. Tones on unix

11. Any available source for Image Dithering/Half-tones/...?

12. How to convert wav file into Mobile Ring Tone

 

 
Powered by phpBB® Forum Software