how to make a mp3 file from the output of my morse code program?

Just starting out? Need help? Post your questions and find answers here.
wimapon3
New User
New User
Posts: 6
Joined: Wed Jun 04, 2025 11:30 am

how to make a mp3 file from the output of my morse code program?

Post by wimapon3 »

I made a program that make morse code sounds... and sends an certain text to the loudspeaker of the computer.

i like to put this signals into a mp3 file , so i can send it by mail to other persons ( who likes to learn morse code)

Wim
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: how to make a mp3 file from the output of my morse code program?

Post by Marc56us »

wimapon3 wrote: Thu Jun 05, 2025 7:30 am I made a program that make morse code sounds... and sends an certain text to the loudspeaker of the computer.
i like to put this signals into a mp3 file , so i can send it by mail to other persons ( who likes to learn morse code)
PB can play mp3 files (with LoadMovies lib) , but cannot create them (as far as I know).
Seymour Clufley
Addict
Addict
Posts: 1265
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: how to make a mp3 file from the output of my morse code program?

Post by Seymour Clufley »

You would probably need to use a utility like SoX or FFMPEG. I wrote a library for using SoX with PB.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
User avatar
idle
Always Here
Always Here
Posts: 5855
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: how to make a mp3 file from the output of my morse code program?

Post by idle »

wouldn't it be easier to compile the program and have it load a text file?
Though you could always use a program like Audacity to record the playback and export as mp3
infratec
Always Here
Always Here
Posts: 7596
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: how to make a mp3 file from the output of my morse code program?

Post by infratec »

An other idea ... MIDI

The files will be smaller than mp3
I will think about how to create morse MIDI files.
Mitchelly
New User
New User
Posts: 1
Joined: Thu Jul 24, 2025 9:56 am

Re: how to make a mp3 file from the output of my morse code program?

Post by Mitchelly »

wimapon3 wrote: Thu Jun 05, 2025 7:30 am I made a program that make morse code sounds... and sends an certain text to the loudspeaker of the computer.

i like to put this signals into a mp3 file , so i can send it by mail to other persons ( who likes to learn morse code)
snow road
Wim
Is there any way to combine using SoX or FFMPEG with the program's source code to automate the mp3 creation process?
infratec
Always Here
Always Here
Posts: 7596
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: how to make a mp3 file from the output of my morse code program?

Post by infratec »

As written:

for morse code all waveform storing makes no sense. It is always larger as the corresponding midi file.

idle implemented my midi version in one of his morse codes :mrgreen:
viewtopic.php?t=87109

And of course, with RunProgram() and the right program you can convert everything to mp3.
User avatar
idle
Always Here
Always Here
Posts: 5855
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: how to make a mp3 file from the output of my morse code program?

Post by idle »

infratec wrote: Thu Jul 24, 2025 10:54 am As written:

for morse code all waveform storing makes no sense. It is always larger as the corresponding midi file.

idle implemented my midi version in one of his morse codes :mrgreen:
viewtopic.php?t=87109

And of course, with RunProgram() and the right program you can convert everything to mp3.
I also changed from beep using your wav generation / catchsound tip as I couldn't record the beep as its generated out of process.
it can now encode, play and record the audio to decode via gortezl filter as well as plain text/morse encode decode
The audio decoding needs a bit more work though that's a case of dynamic timing on and off
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: how to make a mp3 file from the output of my morse code program?

Post by wilbert »

If you do want mp3 output for morse, I guess it should also be possible to have the mp3 data for a dot and the mp3 data for a dash and just chain them all together in the right way. :idea:
Windows (x64)
Raspberry Pi OS (Arm64)
Post Reply