Results 1 to 6 of 6

Thread: Sound Genrator

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2012
    Posts
    20

    Sound Genrator

    Hello Friends,
    I need your help to create simple sinwave sound generator in which i can customize frequency and duration.
    can anybody help me to write its code?

  2. #2
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: Sound Genrator

    You perhaps should elaborate a bit for those of us who think a wav is a rough sea.
    I may be off track, on your needs, but is this the area you are interested in -
    http://www.planet-source-code.com/vb...65169&lngWId=1
    or this -
    http://www.planet-source-code.com/vb...64845&lngWId=1

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2012
    Posts
    20

    Re: Sound Genrator

    I have seen this earlier but there are too many functions and i cannot understand the other functions
    I only need that there is a text box for frequency and duration and play button to play that sine wave.
    I need only simple code.

  4. #4
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Sound Genrator

    I have no idea if this will help you at all but it's all I have to offer and if it isn't just remember that little from some is better than a lot from others
    Attached Files Attached Files


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2012
    Posts
    20

    Re: Sound Genrator

    i want to do something like this

    Option Explicit
    Option Base 1
    Private Sub CommandButton1_Click()
    Dim Sc(3) as integer
    Dim Frequency=440
    Dim Duration = 1000 ' in millisecond
    Sc(1)=1
    Sc(2)=1.125
    Sc(3)=1.2

    For i = 1 to 3
    ' some code is required to play the sine wave sound for above frequency and duration in which Frequency=440*Sc(i)

    next i


    End
    Last edited by jignesh142; Jun 26th, 2012 at 03:32 AM.

  6. #6
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Sound Genrator

    That program I posted has everything you need. It has a Frequency generator, a duration generator, a sine wave and piano keys to give you your sound. I know nothing about sound but I looked at the code and it is very simple to understand even for me. You, who knows more about sound than I do should be able to figure out what you need and modify the code to suite your needs.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width