Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28457 Discussions

Creating Wav Sounds at user informed frequencies

ivomar
Beginner
592 Views
Hello all,

I would like to know if you know the source code to create in fortran .wav sounds at user informed frequencies?

thanks
ivomar
0 Kudos
4 Replies
james1
Beginner
592 Views
You are going to need to be more specific with your question. Do you mean create a .wav file programmatically, produce a sound programmatically, or produce a sound from a pre-existing .wav file?

James
0 Kudos
ivomar
Beginner
592 Views
Yeah, I want to create programmaticaly (source code) that generates .wav files. I want to generate a .wav file with a beep where you can specify its frequency and duration to be played in other programs. Aren't there any modules in Fortran that already perform this task?

Greetings,
Ivomar
0 Kudos
ivomar
Beginner
592 Views
Yeah, I want to create programmaticaly (source code) that generates .wav files. I want to generate a .wav file with a beep where you can specify its frequency and duration to be played in other programs. Aren't there any modules in Fortran that already perform this task?

Greetings,
Ivomar
0 Kudos
joergkuthe
Beginner
592 Views
>...
>I want to generate a .wav file with a beep where you can specify its frequency and duration to be played in other programs.

Why don't you use the WinAPI function
BOOL Beep(
DWORD dwFreq, // sound frequency, in hertz
DWORD dwDuration // sound duration, in milliseconds
);
for this purpose. It's simple to call from within CVF. For example:

USE DFWINTY
USE KERNEL32

INTEGER (DWORD) dwFreq, dwDuration
INTEGER iRet

dwFreq = 200 ! Hz
dwDuration = 1000 ! ms
iRet = Beep(dwFreq, dwDuration)

Joerg Kuthe
www.qtsoftware.de
0 Kudos
Reply