Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Tone generation on the fly

Tone generation on the fly

Scheduled Pinned Locked Moved C#
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Klazen
    wrote on last edited by
    #1

    The object of my program is to play tones through the speakers. I've seen programs that can generate .wav files and then play those, but I need to be able to raise/lower the pitch of the tone while it plays. Something like the Beep() function, but able to play through the speakers, rather than the pc's built in speaker. Note also that I plan to play two different tones through the left and right speakers, so I'll need some way of controlling this as well.

    P A 2 Replies Last reply
    0
    • K Klazen

      The object of my program is to play tones through the speakers. I've seen programs that can generate .wav files and then play those, but I need to be able to raise/lower the pitch of the tone while it plays. Something like the Beep() function, but able to play through the speakers, rather than the pc's built in speaker. Note also that I plan to play two different tones through the left and right speakers, so I'll need some way of controlling this as well.

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Have you read this[^] ?

      K 1 Reply Last reply
      0
      • P PIEBALDconsult

        Have you read this[^] ?

        K Offline
        K Offline
        Klazen
        wrote on last edited by
        #3

        Yes, and unless you see something I'm not, that talks about writing a wav file and then playing it, which isn't what I wanted

        P 1 Reply Last reply
        0
        • K Klazen

          Yes, and unless you see something I'm not, that talks about writing a wav file and then playing it, which isn't what I wanted

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          It can create it in memory, not save it to disk. But apparently it still has to finish writing it before it can play. A couple of weeks ago I was looking for a way to play a tone for as long as the user presses a key, but no joy. :(

          1 Reply Last reply
          0
          • K Klazen

            The object of my program is to play tones through the speakers. I've seen programs that can generate .wav files and then play those, but I need to be able to raise/lower the pitch of the tone while it plays. Something like the Beep() function, but able to play through the speakers, rather than the pc's built in speaker. Note also that I plan to play two different tones through the left and right speakers, so I'll need some way of controlling this as well.

            A Offline
            A Offline
            Anthony Mushrow
            wrote on last edited by
            #5

            This probably won't help, but when i was doing some stuff on Linux a while ago I played some raw audio files, you did it by sending the data directly to the hardware (through drivers or whatever), so you would be able to construct a sample and send it to be played each frame (rather than getting the data from the file). So, basically what i'm saying is, you might need to get down and dirty because i don't think the .Net framework is going to help you much with this.

            My current favourite word is: I'm starting to run out of fav. words!

            -SK Genius

            Game Programming articles start -here[^]-

            K 1 Reply Last reply
            0
            • A Anthony Mushrow

              This probably won't help, but when i was doing some stuff on Linux a while ago I played some raw audio files, you did it by sending the data directly to the hardware (through drivers or whatever), so you would be able to construct a sample and send it to be played each frame (rather than getting the data from the file). So, basically what i'm saying is, you might need to get down and dirty because i don't think the .Net framework is going to help you much with this.

              My current favourite word is: I'm starting to run out of fav. words!

              -SK Genius

              Game Programming articles start -here[^]-

              K Offline
              K Offline
              Klazen
              wrote on last edited by
              #6

              That's what I was afraid of. I suppose I'll take a look into it.

              P 1 Reply Last reply
              0
              • K Klazen

                That's what I was afraid of. I suppose I'll take a look into it.

                P Offline
                P Offline
                PIEBALDconsult
                wrote on last edited by
                #7

                And if you can get it to work, write an article.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups