Link to home
Start Free TrialLog in
Avatar of Consti
Consti

asked on

Input a Text and make special frequenz sound to output..

So hello.
I want to have the code for a proggie where you input a text like:
"ABC ABC"
U press PLAY and it will come some sounds out of the users speaker. They inputed letter "A" should be outputted as a 2200khz sound or something like that.
The letter B should come after a small break of 1 BEEP, a 2300khz BEEP, then (one second break) C as a 2400khz BEEP etc.
So it will play something like:

2200khz (1SecBeep), 1-sec Break, 2300khz (1SecBeep), 1-sec Break, 2400khz (1SecBeep), 2 sec break, 2200khz (1SecBeep), 1-sec Break, 2300khz (1SecBeep), 1-sec Break, 2400khz (1SecBeep),

understand?
Thx for helping!
Cya
Consti
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Hi Consti,

You can try the Beep API:

The Beep function generates simple tones on the speaker. The function is synchronous; it does not return control to its caller until the sound finishes.

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Sub Form_Activate()
    'KPD-Team 1999
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    Dim Cnt As Long
    For Cnt = 0 To 5000 Step 10
        'play a tone of 'Cnt' hertz, for 50 milliseconds
        Beep Cnt, 50
        Me.Caption = Cnt
        DoEvents
    Next Cnt
End Sub
? dwFreq
Windows NT:
Specifies the frequency, in hertz, of the sound. This parameter must be in the range 37 through 32,767 (0x25 through 0x7FFF).
Windows 95:
The parameter is ignored.

? dwDuration
Windows NT:
Specifies the duration, in milliseconds, of the sound.
Windows 95:
The parameter is ignored.
 
Avatar of Consti
Consti

ASKER

Hi Ryancys.
but how to add a sound to a special letter?
I mean if he only would INPUT !ONE! character, it would be easy. But he inputs a undefined number of characters.
It should be a TEXTBOX where he (or SHE ;))can input about 200 or more characters. and there is a button where he can "play" the characters as sounds.
Thx

Consti
-AI1FD6SS3DG8EO7HN4BA0GA5CM9LU0ID3JY2KO1OE7MA9NR8PA6RO4QL5TE2UR1
-
Hi Consti,

I try this before:

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    Randomize
    i = 37 + Int(Rnd(32731))
    Beep i, i
    List1.AddItem Chr$(KeyCode)
End Sub

But just can get one frequent of sound, i don't know if we need to do something setting/modification to the BIOS setting or not, maybe we need other experts to help us now!

regards.
Avatar of Consti

ASKER

Well where ARE THEY?
lol.
I can tell you for what i need this proggie.
Its they idea of something like a "fax" (dont know if the german word is the same as the english).
the User should be able to send crypted messages over a normal phone to another users pc.
Later on, u will be able to use it on your palm and you can send Free-SMS or email.
Just thoughts.
;) thx
Consti
-AI1FD6SS3DG8EO7HN4BA0GA5CM9LU0ID3JY2KO1OE7MA9NR8PA6RO4QL5TE2UR1-
ASKER CERTIFIED SOLUTION
Avatar of pierrecampe
pierrecampe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Consti

ASKER

Thank you! I will try that one immediately.
Thx,
Cya Consti
Hi!

I found this:

Download...
http://www.planetsourcecode.com/vb/scripts/ShowZip.asp?lngWId=1&lngCodeId=21471&strZipAccessCode=ODE%5F214717373

Description:
This example program includes a module file (as well as accompanied .wav files for sound) that will turn a number from a text box into speech through the speakers. Right now works from numbers 1 to 999 trillion. This is just for numbers and a few symbols and does not do words. Please vote if you like it. :)

Snapshot:
http://www.planetsourcecode.com/xq/ASP/txtCodeId.21471/lngWId.1/qx/vb/scripts/ShowCode.htm

But I don't know if it's exactcly what you want.  Hope it helps!

Oh yes, you may want select specific numbers to represent letters.

That's it!

glass cookie : )
Hi!

Found another one:

Download...
http://www.planetsourcecode.com/vb/scripts/ShowZip.asp?lngWId=1&lngCodeId=11334&strZipAccessCode=ODE%5F113347169

Description: This code reads through each letter that may be pasted or typed into a text box and plays a .wav file sound (chromatic notes) for each letter.

That's it!

glass cookie : )
Consti,

Every question you have ever asked is still open. Please resolve them appropriately as soon as possible. Continued disregard of your open questions will result in the force/acceptance of a comment as an answer; other actions affecting your account may also be taken. I will revisit these questions in approximately seven (7) days.

https://www.experts-exchange.com/jsp/qShow.jsp?qid=20169897
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20166962
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20129060
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20128938
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20123540
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20123014
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20105425
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20106785

Thanks,

Netminder
Community Support Moderator
Experts Exchange
Avatar of Consti

ASKER

I am sorry i wasnt able to accept the comments, but i had some real problems with my internet connection
Sorry
Consti