-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes culture formatting bug for SoX commands (#243)
* Fixes culture formatting bug for SoX commands In some cultures, where a comma is used as the decimal separator. In those cases, when we format commands for SoX the numbers would be separated with commas and the command would be invalid. The commit fixes that by ensuring we only use the invariant culture when formatting floating point types. Fices #242 * Fixes mistake in comment
- Loading branch information
Showing
7 changed files
with
152 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
tests/Acoustics.Test/TestHelpers/LeakyFfmpegAudioUtility.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// <copyright file="LeakyFfmpegAudioUtility.cs" company="QutEcoacoustics"> | ||
// All code in this file and all associated files are the copyright and property of the QUT Ecoacoustics Research Group (formerly MQUTeR, and formerly QUT Bioacoustics Research Group). | ||
// </copyright> | ||
|
||
namespace Acoustics.Test.TestHelpers | ||
{ | ||
using System.IO; | ||
using Acoustics.Tools; | ||
using Acoustics.Tools.Audio; | ||
|
||
/// <summary> | ||
/// So named because we use it to break our abstractions, to make them leaky. | ||
/// </summary> | ||
public class LeakyFfmpegAudioUtility : FfmpegAudioUtility | ||
{ | ||
public LeakyFfmpegAudioUtility(FileInfo ffmpegExe, FileInfo ffprobeExe) | ||
: base(ffmpegExe, ffprobeExe) | ||
{ | ||
} | ||
|
||
public LeakyFfmpegAudioUtility(FileInfo ffmpegExe, FileInfo ffprobeExe, DirectoryInfo temporaryFilesDirectory) | ||
: base(ffmpegExe, ffprobeExe, temporaryFilesDirectory) | ||
{ | ||
} | ||
|
||
public string GetConstructedModifyArguments(FileInfo source, FileInfo output, AudioUtilityRequest request) | ||
{ | ||
return this.ConstructModifyArgs(source, output, request); | ||
} | ||
|
||
public string GetConstructedInfoArguments(FileInfo source, FileInfo output, AudioUtilityRequest request) | ||
{ | ||
return this.ConstructInfoArgs(source); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// <copyright file="LeakySourcePreparer.cs" company="QutEcoacoustics"> | ||
// All code in this file and all associated files are the copyright and property of the QUT Ecoacoustics Research Group (formerly MQUTeR, and formerly QUT Bioacoustics Research Group). | ||
// </copyright> | ||
|
||
namespace Acoustics.Test.TestHelpers | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Acoustics.Shared; | ||
using Acoustics.Tools; | ||
using Acoustics.Tools.Audio; | ||
|
||
/// <summary> | ||
/// So named because we use it to break our abstractions, to make them leaky. | ||
/// </summary> | ||
public class LeakySoxAudioUtility : SoxAudioUtility | ||
{ | ||
public LeakySoxAudioUtility(FileInfo soxExe) | ||
: base(soxExe) | ||
{ | ||
} | ||
|
||
public LeakySoxAudioUtility(FileInfo soxExe, DirectoryInfo temporaryFilesDirectory, bool enableShortNameHack = true) | ||
: base(soxExe, temporaryFilesDirectory, enableShortNameHack) | ||
{ | ||
} | ||
|
||
public string GetConstructedModifyArguments(FileInfo source, FileInfo output, AudioUtilityRequest request) | ||
{ | ||
return this.ConstructModifyArgs(source, output, request); | ||
} | ||
|
||
public string GetConstructedInfoArguments(FileInfo source) | ||
{ | ||
return this.ConstructInfoArgs(source); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters