For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

[ALAudio] - Looping sounds aren't quite handled properly.

This forum is for the new audio renderer for UEngine 1 based games, like Unreal, UnrealTournament, DeusEx and Rune. Missing a Game? Want to develop yourself? Let us know!
Post Reply
User avatar
スマイル・ドラゴン
OldUnreal Member
Posts: 1263
Joined: Sun Feb 10, 2008 9:07 pm

[ALAudio] - Looping sounds aren't quite handled properly.

Post by スマイル・ドラゴン »

There are alot of looping sounds using the sampler chunk for loop start\end data.

Most of these sounds are somewhat "pure tone" where you can hear a noticable and very loud POP noise when they are looped improperly and there's a ~2-4 sample gap between "restarting" the looping sound.

Examples of sounds exhibiting popping are most of the "hum" sounds in AmbModern and some deep low hum like wind noises from AmbOutside.

Can this be fixed possibly? Or is this a OpenALSoft issue?

Information on this chunk can be found here:
[url]http://www.piclist.com/techref/io/serial/midi/wave.html[/url]
(CTRL+F Sampler Chunk)
“I am the dragon without a name.”
Ðàrk-_¦_-Ñïght.: / κυνικός Δράκων / スマイル・ドラゴン / Draco Nihil
User avatar
Smirftsch
Administrator
Posts: 8999
Joined: Wed Apr 29, 1998 10:00 pm
Location: NaPali
Contact:

Re: [ALAudio] - Looping sounds aren't quite handled properly.

Post by Smirftsch »

It's a while ago, but not THAT long ago, I've been working on this and also changed/fixed some stuff with looping already, I assumed all trouble with loops to be fixed. Annoying part is that I already forgot some of the details about it again :P

Here is what I use right now for loop point detection:

Code: Select all

bool GetSampleLoop( const BYTE* Data, const BYTE* DataEnd, INT* LoopStart, INT* LoopEnd )
{
      // Find looping points.
      FWaveFileHeader* FileHead = (FWaveFileHeader*)Data;
      if( appStrcmp(FileHead->GetIDStr(),TEXT("RIFF")) )
      {
            debugf(NAME_DevSound, TEXT("No RIFF in '%s'"), FileHead->GetIDStr());
            return false; // Not a wave format.
      }
      DataEnd = Min(DataEnd,Data+FileHead->ChunkSize+sizeof(WaveChunkHeader));
      Data+=sizeof(FWaveFileHeader);

      WaveChunkHeader* FileFormatHead = (WaveChunkHeader*)Data;
      if( appStrcmp(FileFormatHead->GetIDStr(),TEXT("fmt ")) )
      {
            debugf(NAME_DevSound, TEXT("Audio invalid format '%s'"), FileFormatHead->GetIDStr());
            return false; // Not a wave format.
      }
      Data+=sizeof(WaveChunkHeader);
      //FFormatChunkData* FormatData = (FFormatChunkData*)Data;
      Data+=FileFormatHead->ChunkSize;

      DataEnd-=(sizeof(WaveChunkHeader)-1);

      // Parse until end of file or until we find sampler chunk.
      while( DataChunkID[0] || DataHead->ChunkID[0]>127 ) // Faulty format?
            {
                  ++Data;
                  DataHead = (WaveChunkHeader*)Data;
                  if( !DataHead->ChunkID[0] || DataHead->ChunkID[0]>127 )
                        break;
            }
            if( !appStrcmp(DataHead->GetIDStr(),TEXT("smpl")) )
            {
                  Data+=sizeof(WaveChunkHeader);
                  SamplerChunkData* Smpl = (SamplerChunkData*)Data;
                  if( Smpl->NumSampleLoops )
                  {
                        Data+=sizeof(SamplerChunkData);
                        FSamplerLoop* Loop = (FSamplerLoop*)Data;
                        if( LoopStart )
                              *LoopStart = Loop->Start;
                        if( LoopEnd )
                              *LoopEnd = Loop->End;
                        return true;
                  }
                  break;
            }
            else Data+=sizeof(WaveChunkHeader)+DataHead->ChunkSize;
      }
      return false;
}
The update is done during ::Update function, so this is only as accurate as this function is called (tick), so this perhaps already is enough for the problem described, but this is only one idea I have right now.
Last edited by Smirftsch on Mon Jun 27, 2016 7:20 am, edited 1 time in total.
Sometimes you have to lose a fight to win the war.
User avatar
スマイル・ドラゴン
OldUnreal Member
Posts: 1263
Joined: Sun Feb 10, 2008 9:07 pm

Re: [ALAudio] - Looping sounds aren't quite handled properly.

Post by スマイル・ドラゴン »

I think that may be the problem then, execution rate\tickrate causing popping noises. I wonder how Galaxy handled this or maybe if OpenALSoft can natively handle such a thing if a patch got submitted?
“I am the dragon without a name.”
Ðàrk-_¦_-Ñïght.: / κυνικός Δράκων / スマイル・ドラゴン / Draco Nihil
Post Reply

Return to “ALAudio (OpenAL), FMOD (FMOD3 and FMOD Ex) or other new audio renderer for UEngine 1 Games”