logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic [ALAudio] - Looping sounds aren't quite handled properly. (Read 1628 times)
スマイル・ドラゴン
Betatester
Offline


『smile。。。』

Posts: 1236
Location: Independence, KS
Joined: Feb 10th, 2008
Gender: Male
[ALAudio] - Looping sounds aren't quite handled properly.
Jun 26th, 2016 at 11:06pm
Print Post  
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:
http://www.piclist.com/techref/io/serial/midi/wave.html
(CTRL+F Sampler Chunk)
  

I am the dragon without a name.
rk-__-ght.: / κυνικός Δράκων / スマイル・ドラゴン / Draco Nihil
Back to top
IP Logged
 
Smirftsch
Forum Administrator
*****
Offline



Posts: 7994
Location: at home
Joined: Apr 30th, 1998
Gender: Male
Re: [ALAudio] - Looping sounds aren't quite handled properly.
Reply #1 - Jun 27th, 2016 at 7:15am
Print Post  
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 Tongue

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

Code (C++)
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( Data<DataEnd )
	{
		WaveChunkHeader* DataHead = (WaveChunkHeader*)Data;

		if( !DataHead->ChunkID[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.
  

Sometimes you have to lose a fight to win the war.
Back to top
WWWICQ  
IP Logged
 
スマイル・ドラゴン
Betatester
Offline


『smile。。。』

Posts: 1236
Location: Independence, KS
Joined: Feb 10th, 2008
Gender: Male
Re: [ALAudio] - Looping sounds aren't quite handled properly.
Reply #2 - Jun 27th, 2016 at 8:21am
Print Post  
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
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo