Skip to content

Commit

Permalink
#2078 Broadcastify feed verbose logging now includes logging of audio…
Browse files Browse the repository at this point in the history
… and metadata
  • Loading branch information
Dennis Sheirer committed Nov 2, 2024
1 parent a12040b commit e644a1c
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ protected void broadcastAudio(byte[] audio, IdentifierCollection identifierColle
{
if(mInlineActive)
{
byte[] metadata = IcecastMetadata.formatInline(IcecastMetadata.getTitle(identifierCollection, mAliasModel)).getBytes();
if (mInlineRemaining == -1)
{
mInlineRemaining = mInlineInterval;
Expand All @@ -105,16 +104,34 @@ protected void broadcastAudio(byte[] audio, IdentifierCollection identifierColle
byte[] chunk = Arrays.copyOfRange(audio, audioOffset, Math.min(audioOffset + mInlineRemaining, audio.length));
mInlineRemaining -= chunk.length;
audioOffset += chunk.length;

if(mVerboseLogging)
{
mLog.info("Broadcasting audio data - sending [" + chunk.length + "/" + audio.length + "] bytes");
}

mStreamingSession.write(chunk);
if(mInlineRemaining == 0)
{
mInlineRemaining = mInlineInterval;

byte[] metadata = IcecastMetadata.formatInline(IcecastMetadata.getTitle(identifierCollection, mAliasModel)).getBytes();

if(mVerboseLogging)
{
mLog.info("Sending inline metadata: " + new String(metadata));
}

mStreamingSession.write(metadata);
}
}
}
else
{
if(mVerboseLogging)
{
mLog.info("Broadcasting audio data [" + audio.length + "] bytes");
}
mStreamingSession.write(audio);
}
}
Expand Down

0 comments on commit e644a1c

Please sign in to comment.