Playing .wav samples and noise distortion

Find quick help here to get you started with Hollywood
g0blin
Posts: 77
Joined: Tue Oct 04, 2011 9:06 am

Playing .wav samples and noise distortion

Post by g0blin »

Hello everyone,

I coded a (very) basic 2D fighter game (code published in "Showcase section). Of course, it uses various sound effects when players hit each other.
This samples are played as below:

If IsSamplePlaying(4)=False Then PlaySample(4)

The result is fine under Windows, but when I play the same sample under AmigaOS4 I get a very distorted sound. I thought it could be a AHI settings problem, but the sample is played just fine by Multiview.

Inside the game I make use of "bounce.wav" from Hollywood boing demo. It works fine. I analyzed the two samples:
- bounce.wav: 8bit per sample; 11025 sampling rate;
- my sample: 16bit per sample; 16000 sampling rate.

Any sugestion anyone?

Regards
g0blin
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Playing .wav samples and noise distortion

Post by airsoftsoftwair »

Do other samples work with PlaySample()? Or do they all sound distorted?
g0blin
Posts: 77
Joined: Tue Oct 04, 2011 9:06 am

Re: Playing .wav samples and noise distortion

Post by g0blin »

Hi Andreas,

all other samples seem to work fine. I replaced my sound effects, taken from "Tekken" game fighters' voices, with some ".wav" samples taken from "Swamp defence". No problems with those files. The code itself seems to work fine. Under Windows PlaySample and PlayMusic are ok. I was now trying to optimize the code for my Sam440ep-flex. Since I still miss mpega.library, I commented out the music and started working with those samples. I have no idea if the sampling rate could be a factor.
g0blin
Posts: 77
Joined: Tue Oct 04, 2011 9:06 am

Re: Playing .wav samples and noise distortion

Post by g0blin »

Andreas,

I noticed something else. I replaced my ".mp3" music with a ".wav" file taken from WordMeUpXXL. This file is the intro background music of WMUPXXL.
If pre-loaded with:
@MUSIC 1,"wmupxxl_intro.wav"

I get the following error message:
Cannot open mpega.library!

But the file IS a ".wav"! If I pre-load it with @SAMPLE, during game playing I only get a continuous very distorted sound.
The weird thing isthat all files play correctly with MultiView. (except mp3, since I don't have that library yet).

I'm clueless.
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Playing .wav samples and noise distortion

Post by airsoftsoftwair »

It might be a compressed WAVE file. Hollywood currently only supports uncompressed WAVE files. Can you upload the WAVE file that sounds distorted somewhere? Then I can check if it's happening here too.
User avatar
Juan Carlos
Posts: 889
Joined: Mon Sep 06, 2010 1:02 pm

Re: Playing .wav samples and noise distortion

Post by Juan Carlos »

This distorsion in the wav files and mp3 files using mpga.librery (for mp3) has appeared now qith update 4, before the mp3 files Hollywood plays perfect, because I tested this strange problem with my Sirena Player, with the update 3 the mp3 hadn't distorsion but now with my new version tested the strange distorsion is present.
g0blin
Posts: 77
Joined: Tue Oct 04, 2011 9:06 am

Re: Playing .wav samples and noise distortion

Post by g0blin »

@Andreas
I'll send you an e-mail in a moment with the offending filea.

@Juan
I don't know about MP3s, but I had a distortion problem with those very files since upd2
User avatar
Juan Carlos
Posts: 889
Joined: Mon Sep 06, 2010 1:02 pm

Re: Playing .wav samples and noise distortion

Post by Juan Carlos »

@g0blin

I have this problem since update4, because I use my own player Sirena Player (programmed with hollywood 4.8) and with this last update the mp3 has the distorsion only in Amiga OS4 because under Windos7 (where I use my own player much) there isn't this problem, only there are other problems as the mp3 files of more 192kbytes, where Hollywood can'ts player this files with so quality.
Because the problem, we need a good Hollywood for Amiga systems instead of Hollywood for Windos, Linux or yes, Android.
g0blin
Posts: 77
Joined: Tue Oct 04, 2011 9:06 am

Re: Playing .wav samples and noise distortion

Post by g0blin »

@Juan

As Andreas said, it could be a problem with compressed .wav files. I thought this format was uncompressed, but this explains the "can't open mpega.library" message I encountered using WorldMeUp XXl intro music.

I guess Andreas is working to fix this. I personally can't make my own music or sound fx, so I rely on other people to create the background for my code.

By the way, I can't find the original mpega.library on the net. I guess I have to recompile the package from scratch.

Regards g0blin
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Playing .wav samples and noise distortion

Post by airsoftsoftwair »

This is fixed now. The problem was that Hollywood wasn't able to handle 16-bit samples with OS4's sound.datatype because the OS4 sound.datatype has got 16-bit support just recently. Hollywood still thought that it was limited to 8-bit samples only.
Post Reply