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?
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.
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
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.
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.
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.