- better looping sound
This commit is contained in:
@@ -1009,13 +1009,13 @@ namespace lime
|
|||||||
if (active && !playing())
|
if (active && !playing())
|
||||||
alSourcePlay(source);
|
alSourcePlay(source);
|
||||||
|
|
||||||
if (!active && mLoops > 0)
|
/*if (!active && mLoops > 0)
|
||||||
{
|
{
|
||||||
mLoops --;
|
mLoops --;
|
||||||
double seek = mStartTime * 0.001;
|
double seek = mStartTime * 0.001;
|
||||||
ov_time_seek(oggStream, seek);
|
ov_time_seek(oggStream, seek);
|
||||||
return update();
|
return update();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
return active;
|
return active;
|
||||||
|
|
||||||
@@ -1037,7 +1037,13 @@ namespace lime
|
|||||||
size += result;
|
size += result;
|
||||||
else
|
else
|
||||||
if(result < 0) {
|
if(result < 0) {
|
||||||
|
|
||||||
|
if ( mLoops > 0 ) {
|
||||||
|
mLoops --;
|
||||||
|
ov_time_seek(oggStream, 0);
|
||||||
|
}else{
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
//LOG_SOUND ("Result is less than 0");
|
//LOG_SOUND ("Result is less than 0");
|
||||||
//throw errorString(result);
|
//throw errorString(result);
|
||||||
}
|
}
|
||||||
@@ -1045,8 +1051,16 @@ namespace lime
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(size <= 0) {
|
if(size <= 0) {
|
||||||
alSourceStop(source);
|
if ( mLoops > 0 ) {
|
||||||
return false;
|
mLoops --;
|
||||||
|
ov_time_seek(oggStream, 0);
|
||||||
|
return stream( buffer );
|
||||||
|
}else{
|
||||||
|
alSourceStop(source);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
alBufferData(buffer, format, pcm, size, vorbisInfo->rate);
|
alBufferData(buffer, format, pcm, size, vorbisInfo->rate);
|
||||||
|
|||||||
Reference in New Issue
Block a user