884
« on: March 06, 2017, 07:37:20 pm »
I have tried converting to FLAC and OGG just from the context menu. On my eCS 2.2 b2 system, this does not result in a playable file for either format. I understand more work has been done on these codecs.
I tried modifying the sox command to produce 2 channel files. This seems to fix all problems I had with a few files. I tried playing one of the QT games, and early in the play, I got a trap in the USB driver. (see attached photo of trap screen) Converting the sound file eliminates the trap.
Now I an suspicious that any WAV file might need converting unless it is already 2 channel 16 bit 44.1 KHz.
Modified code with new sox invocation that gives stereo
/* batch file to convert from old style wave files to
stereo 16-bit 44.1 KHz ones. Requires sox to run.
All sounds in the OS/2 multimedia directory are converted
A backup named IBMSOUND.ZIP is created.
*/
soundDir = SysBootDrive() || '\MMOS2\SOUNDS'
backupZip = SysBootDrive() || '\MMOS2\IBMSOUND.ZIP'
if stream(backupZip, 'c', 'query exists') <> '' then do
say "No backup created becuase file already exists:" backupZip
end
else do
'zip -qr' backupZip soundDir
if rc <> 0 then do
say "backup file created:" backupZip
end
end
call SysFileTree soundDir || '\*.wav', 'wav.', 'FOS'
do i=1 to wav.0
soundPointer = lastpos('.wav', wav.i)
outputFile = left(wav.i, soundPointer - 1) || '4.wav'
'sox "' || wav.i || '" -b 16 -c 2 "' || outputFile || '" rate -s -a 44100 dither -s'
if rc = 0 then do
say 'converted' filespec('Name', outputFile)
'copy "' || outputFile || '" "' || wav.i || '"'
if rc <> 0 then do
say 'Error' rc 'updating' wav.i
end
'del' outputFile
end
end
return