Skip to content

Commit

Permalink
More naudio fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Dec 16, 2023
1 parent 7e55e82 commit 463c715
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions FRBDK/Glue/NAudioPlugin/Embedded/NAudio_Song.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,21 @@ public bool IsRepeating

public NAudio_Song(string fileName)
{
var extension = FlatRedBall.IO.FileManager.GetExtension(fileName);
var fullFile = fileName;
if (FileManager.IsRelative(fullFile))
{
fullFile = FileManager.RelativeDirectory + fileName;
}
var extension = FlatRedBall.IO.FileManager.GetExtension(fullFile);
if (extension == "mp3")
{
#if DEBUG
if(!System.IO.File.Exists(fileName))
if(!System.IO.File.Exists(fullFile))
{
throw new FileNotFoundException($"Could not find NAudio song file: {fileName}");
throw new FileNotFoundException($"Could not find NAudio song file: {fullFile}");
}
#endif
this.reader = new AudioFileReader(fileName);
this.reader = new AudioFileReader(fullFile);
loopStream = new LoopStream(reader);
}
else
Expand Down

0 comments on commit 463c715

Please sign in to comment.