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. Generate Sound

Generate Sound

Scheduled Pinned Locked Moved C#
question
8 Posts 4 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.
  • R Offline
    R Offline
    Reelix
    wrote on last edited by
    #1

    Hello all! I'm wondering if anyone has any idea to generate specific frequencies? I am aware of Console.Beep(), but that plays through the PC-Speaker (Or Console Speaker, as it says in the tooltip) I'm wondering if there's a way to do this to play through your regular sound device (Eg: Speakers / Headphones) I thank you for your time! - Reelix

    -= Reelix =-

    OriginalGriffO D R 3 Replies Last reply
    0
    • R Reelix

      Hello all! I'm wondering if anyone has any idea to generate specific frequencies? I am aware of Console.Beep(), but that plays through the PC-Speaker (Or Console Speaker, as it says in the tooltip) I'm wondering if there's a way to do this to play through your regular sound device (Eg: Speakers / Headphones) I thank you for your time! - Reelix

      -= Reelix =-

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      The easiest way I know of is to use the system.media.soundplayer class - admitedly this only plays .WAV files, but it should be easy to create the frequencies you want as individual files.

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      R 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        The easiest way I know of is to use the system.media.soundplayer class - admitedly this only plays .WAV files, but it should be easy to create the frequencies you want as individual files.

        R Offline
        R Offline
        Reelix
        wrote on last edited by
        #3

        All 100K+ of them? :p

        -= Reelix =-

        OriginalGriffO 1 Reply Last reply
        0
        • R Reelix

          Hello all! I'm wondering if anyone has any idea to generate specific frequencies? I am aware of Console.Beep(), but that plays through the PC-Speaker (Or Console Speaker, as it says in the tooltip) I'm wondering if there's a way to do this to play through your regular sound device (Eg: Speakers / Headphones) I thank you for your time! - Reelix

          -= Reelix =-

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #4

          System.Media.SoundPlayer has a constructor overload that has a Stream parameter[^] so you can construct your waveform in a MemoryStream and pass that to the SoundPlayer's constructor.

          Dave
          BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
          Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
          Why are you using VB6? Do you hate yourself? (Christian Graus)

          1 Reply Last reply
          0
          • R Reelix

            All 100K+ of them? :p

            -= Reelix =-

            OriginalGriffO Offline
            OriginalGriffO Offline
            OriginalGriff
            wrote on last edited by
            #5

            Hmm. Might take a little time then. Why so many - the human hearing range is only 20 -> 20,000 Hz. Are we writing software for bats now?

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

            R 1 Reply Last reply
            0
            • OriginalGriffO OriginalGriff

              Hmm. Might take a little time then. Why so many - the human hearing range is only 20 -> 20,000 Hz. Are we writing software for bats now?

              R Offline
              R Offline
              Reelix
              wrote on last edited by
              #6

              Heh heh :) I just want a free input on the frequency you can enter :) I was thinking of having a .wav file at a pre-set frequency, then somehow modifying the output frequency based on what the user inputs, then play that... Also, I've realised that Googling "C#"+Piano (To look for an example of ones already made) has rather irritating results, as you might imagine ;)

              -= Reelix =-

              1 Reply Last reply
              0
              • R Reelix

                Hello all! I'm wondering if anyone has any idea to generate specific frequencies? I am aware of Console.Beep(), but that plays through the PC-Speaker (Or Console Speaker, as it says in the tooltip) I'm wondering if there's a way to do this to play through your regular sound device (Eg: Speakers / Headphones) I thank you for your time! - Reelix

                -= Reelix =-

                R Offline
                R Offline
                Ravi Bhavnani
                wrote on last edited by
                #7

                Clickety[^] /ravi

                My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

                R 1 Reply Last reply
                0
                • R Ravi Bhavnani

                  Clickety[^] /ravi

                  My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

                  R Offline
                  R Offline
                  Reelix
                  wrote on last edited by
                  #8

                  Wow - I never knew about that! Thanks!!! :-D

                  -= Reelix =-

                  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