Skip to content

Commit

Permalink
Emit some more audio properties for CD
Browse files Browse the repository at this point in the history
  • Loading branch information
pudding committed Jan 28, 2024
1 parent 1690d39 commit e35f5b3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions FoxTunes.Output.Bass.Cd/BassCdMetaDataSourceStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ namespace FoxTunes
{
public class BassCdMetaDataSourceStrategy : BaseComponent, IBassCdMetaDataSourceStrategy
{
const int BIT_RATE = 1411;

const int CHANNELS = 2;

const int SAMPLE_RATE = 44100;

const int BITS_PER_SAMPLE = 16;

public BassCdMetaDataSourceStrategy(int drive)
{
this.Drive = drive;
Expand Down Expand Up @@ -37,6 +45,22 @@ public virtual IEnumerable<MetaDataItem> GetProperties(int track)
//What the fuck is this? Something to do with 44.1kHz/16bit?
Value = ((BassCd.GetTrackLength(this.Drive, track) / 176400) * 1000).ToString()
};
yield return new MetaDataItem(CommonProperties.AudioBitrate, MetaDataItemType.Property)
{
Value = BIT_RATE.ToString()
};
yield return new MetaDataItem(CommonProperties.AudioChannels, MetaDataItemType.Property)
{
Value = CHANNELS.ToString()
};
yield return new MetaDataItem(CommonProperties.AudioSampleRate, MetaDataItemType.Property)
{
Value = SAMPLE_RATE.ToString()
};
yield return new MetaDataItem(CommonProperties.BitsPerSample, MetaDataItemType.Property)
{
Value = BITS_PER_SAMPLE.ToString()
};
}
}
}

0 comments on commit e35f5b3

Please sign in to comment.