WAV File and ZCM File streaming player.

Post Reply
User avatar
ahenry3068
Posts: 1134
Joined: Tue Apr 04, 2023 9:57 pm

WAV File and ZCM File streaming player.

Post by ahenry3068 »

FIXED:

WEDNESDAY, JULY 17th, 2024. Updated to 1.1.
Player will now activate fast serial mode on ROM version r47 and higher, this will allow it to play 16 bit 44100 Hz STEREO WAV files


Simple text interface PCM Audio player. Supports 16 bit Stereo & Mono PCM WAV files. 8 bit is not supported because 8 bit signed audio data (which the VERA needs for 8 bit play) is not a supported part of the WAV file specification. 8 bit WAV files use 8 bit unsigned data. That doesn't work on VERA (I know, I tried. BIG NOPE) ... Also supports ZCM files and will support 8 bit ZCM files. It will play the HUGE ZCM's created by my convertor program also on this forum.

Successfully tested on hardware with a Mono stream all the way to the Max VERA PCM rate which is 48828.15 khz. 48khz is Digital DAT rate. So very high quality Mono audio. I got stereo to work successfully on Hardware up to 16bit 32khz with the Burst rate enabled on r47. Up to about 28khz Stereo should work on any X16 hardware. Unfortunately the X16 just doesn't have quite enough oomph to successfully play 44100 hz 16 bit stereo files. :cry: If you want stereo you need to settle for around 30 khz sample rate on hardware. On HOSTFS 44100 stereo does play fine, but not on actual Hardware.
(This is no longer true. Will play 44100 stereo on hardware if r47 or higher)

This program was written in XC=BASIC with a good bit of Inline Assembly for the actual "Feeding the PCM FIFO" part of the code. Source code and a few sample Audio files are included in the archive. Please feel free to ping me if you find a file you think it should play but it will not.


OLD VERSION: NEW ONE IS BELOW
playwav.zip
(35.36 MiB) Downloaded 96 times

Added another version that I think is better. I debated opening a New thread but I don't want to clutter things up. Here is the new version. Different approach to the code. The Main Module is written in BASLOAD. The program loads a Hi-Ram BIN with the PCM Playing routine in compiled XC=BASIC (all source code included) I think XC=BASIC has a bug (or 2) in it's string handling routines. The above program occasionally (but infrequently) develops some string variable corruption which makes things go wrong. This version is Solid so far as I can tell. The XC=BASIC module does NO String Handling.
Controls: SPACE BAR - Pause / UnPause ESC - Exit play Up/Down Arrows - Volume Control

Player 1.0 was downloaded 87 times.
NEW VERSION 1.1
PCMPLAYER1.1.zip
(44.19 MiB) Downloaded 100 times

User Interface is deliberately similar to my BMX viewing program.
UI.png
UI.png (17.2 KiB) Viewed 2236 times
PLAYING.png
PLAYING.png (18.15 KiB) Viewed 2236 times
Last edited by ahenry3068 on Wed Jul 17, 2024 11:06 pm, edited 7 times in total.
User avatar
ahenry3068
Posts: 1134
Joined: Tue Apr 04, 2023 9:57 pm

VERSION UPDATE: Will play 44100 Stereo WAV's

Post by ahenry3068 »

WEDNESDAY, JULY 17th, 2024. Updated to 1.1.
Player will now activate fast serial mode on ROM version r47 and higher, this will allow it to play 16 bit 44100 Hz STEREO WAV files ON HARDWARE !!!



https://cx16forum.com/forum/viewtopic.php?t=7771
the_seb
Posts: 19
Joined: Mon Feb 14, 2022 3:25 pm

Re: WAV File and ZCM File streaming player.

Post by the_seb »

The samples gaga41000 does not play correcly on my system the sound is cracking a lot.

the file is good when played on my pc.
User avatar
ahenry3068
Posts: 1134
Joined: Tue Apr 04, 2023 9:57 pm

Re: WAV File and ZCM File streaming player.

Post by ahenry3068 »

the_seb wrote: Thu Jul 18, 2024 4:05 pm The samples gaga41000 does not play correcly on my system the sound is cracking a lot.

the file is good when played on my pc.
I'm on the road I won't be able to check it for a few days. Are you on r47 ? That is required for the higher bit rate
the_seb
Posts: 19
Joined: Mon Feb 14, 2022 3:25 pm

Re: WAV File and ZCM File streaming player.

Post by the_seb »

i"m on the r47 rom release
git 64737446
vera 47.0.2
smc 47.2.3
cpu 65C02 (the 816 also bug)

i will try to test if my x16 meet the speed expectation on other program.

edit: clock speed return 3809 . my board run at 8 mhz.

x16speed return 2494
r47 emulator return 248A

playback work on emulator

edit 2:

FOUND!!!

i use a different sd card than the one provided with the x16 and it work
the_seb
Posts: 19
Joined: Mon Feb 14, 2022 3:25 pm

Re: WAV File and ZCM File streaming player.

Post by the_seb »

test.jpg
test.jpg (123.56 KiB) Viewed 1938 times

at the top my old 2016 sandisk extreme

at the bottom the SP 8 G card

not a big difference but it"s night and day for this aplication
User avatar
ahenry3068
Posts: 1134
Joined: Tue Apr 04, 2023 9:57 pm

Re: WAV File and ZCM File streaming player.

Post by ahenry3068 »

Glad you got it sorted. I'm not surprised the sdcard made the difference. This is really pushing what is possible. A month ago I would have said and did say it can't be done.
Post Reply