Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:58 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Audio sample playback from within MMBASIC

Author Message
frnno967
Senior Member

Joined: 02/10/2020
Location: United States
Posts: 104
Posted: 12:12am 10 Dec 2020
Copy link to clipboard 
Print this post

I'm toying around with having Maxiterm play a sound for every character RX/TX. I really want to have a sound like the one from Wargames, but I can't figure out the best way to accomplish the task.

It sounds pretty good if I play an MP3 file for each character but I would rather not add an additional file that must be present for the feature to work. Is there a way to encode the audio sample values within the program itself, then call a subroutine to play them every time I want the sound?

Or should I just bite the bullet and include the sound file and distribute both as a .zip? And if I go this route, what command is best for checking of the presence of a file before it is played?

Thanks!
Jay Crutti: Ham Radio Operator, K5JCJ. Computer Enthusiast. Musician. Engineer.
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 01:46am 10 Dec 2020
Copy link to clipboard 
Print this post

How about PLAY SOUND ?
my site
 
frnno967
Senior Member

Joined: 02/10/2020
Location: United States
Posts: 104
Posted: 03:17am 10 Dec 2020
Copy link to clipboard 
Print this post

  hitsware2 said  How about PLAY SOUND ?


The original sound is a bit too multitimbral for PLAY SOUND. I tried that at first but the limited number of voices (4) combined with envelope characteristics meant that at best it sounded like a pure tone, but usually was very choppy and not close to the intended sound. Maybe if there was some ADSR parameters I could make it work, but I also don't know enough about the original sound yet to re-create it.
Jay Crutti: Ham Radio Operator, K5JCJ. Computer Enthusiast. Musician. Engineer.
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 03:27am 10 Dec 2020
Copy link to clipboard 
Print this post

You could convert that mp3 to a wav.
Then, look at the sound code in Martin Scragg's Max-E-Man pacman game.
Way down in the program, look for the "ReadWav" subroutine to see how how he loaded the sounds into arrays. In principle, you should be able to convert the array of sound data into data statement values.
The "MakeNoise" subroutine shows how to feed the array to the DAC.

It's gonna be big though - 10k or more perhaps.
Visit Vegipete's *Mite Library for cool programs.
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 04:35am 10 Dec 2020
Copy link to clipboard 
Print this post

Do you require a single sound ,
or multiple frequencies ?
my site
 
frnno967
Senior Member

Joined: 02/10/2020
Location: United States
Posts: 104
Posted: 04:35am 10 Dec 2020
Copy link to clipboard 
Print this post

  vegipete said  You could convert that mp3 to a wav.
Then, look at the sound code in Martin Scragg's Max-E-Man pacman game.
Way down in the program, look for the "ReadWav" subroutine to see how how he loaded the sounds into arrays. In principle, you should be able to convert the array of sound data into data statement values.
The "MakeNoise" subroutine shows how to feed the array to the DAC.

It's gonna be big though - 10k or more perhaps.


This is perfect. I can downsample the WAV file to a very small size and make it work, but just couldn't figure out the procedure to do it. Thanks for the advice!
Jay Crutti: Ham Radio Operator, K5JCJ. Computer Enthusiast. Musician. Engineer.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025