Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SoX failing sometimes due to culture decimal point differences #242

Closed
atruskie opened this issue Jun 26, 2019 · 2 comments · Fixed by #243
Closed

SoX failing sometimes due to culture decimal point differences #242

atruskie opened this issue Jun 26, 2019 · 2 comments · Fixed by #243
Assignees
Labels

Comments

@atruskie
Copy link
Member

Describe the bug

SoX failed to segment a recording. Log excerpt:

2019-06-25T10:06:01.6885800-03:00 [12] DEBUG Acoustics.Tools.Audio.MasterAudioUtility - Converting and segmenting audio/wav file D:\Tesis\DSC\AP_analysis\Mixdown1.1hs.wav to wav D:\Tesis\DSC\results_AP.exe\Towsey.Acoustic\dg3rquzruhmzxfw5oh5c0th3nqdh4ahg.wav using sox. Settings: Request starts at 1 hour 18 minutes (4680000ms) and finishes at 1 hour 18 minutes 39 seconds (4719604ms) (39 seconds 604 ms 39604ms). Sample rate of 22050 hertz.Mix channels down to mono.
2019-06-25T10:06:01.6895801-03:00 [12] VERBOSE ProcessRunner - 393: Process runner arguments: -R  -q -V4 "D:\Tesis\DSC\AP_analysis\Mixdown1.1hs.wav" -t wavpcm "D:\Tesis\DSC\results_AP.exe\Towsey.Acoustic\dg3rquzruhmzxfw5oh5c0th3nqdh4ahg.wav" trim 4680 39,6039999999994 rate -v -s -a 22050 remix - 
2019-06-25T10:06:01.7155816-03:00 [12] VERBOSE ProcessRunner - 393: Process exited without timing out: 1
2019-06-25T10:06:01.7165816-03:00 [12] DEBUG Acoustics.Tools.Audio.SoxAudioUtility - Executed sox.exe in working directory D:\Tesis\DSC\results_AP.exe\Towsey.Acoustic. Took 26 ms (26.582ms). Exit code: 1
2019-06-25T10:06:01.7165816-03:00 [12] VERBOSE Acoustics.Tools.Audio.SoxAudioUtility - Process runner output for sox.exe:
Arguments:  -R  -q -V4 "D:\Tesis\DSC\AP_analysis\Mixdown1.1hs.wav" -t wavpcm "D:\Tesis\DSC\results_AP.exe\Towsey.Acoustic\dg3rquzruhmzxfw5oh5c0th3nqdh4ahg.wav" trim 4680 39,6039999999994 rate -v -s -a 22050 remix - 
Error output: D:\AP\audio-utils\windows\sox\sox.exe:      SoX v14.4.2
time:     Feb 22 2015 15:05:01
compiler: gcc 4.9.2 20141030 (Fedora MinGW 4.9.2-1.fc21)
arch:     1248 48 44 L OMP
D:\AP\audio-utils\windows\sox\sox.exe INFO formats: detected file format type `wav'
D:\AP\audio-utils\windows\sox\sox.exe DBUG wav: Searching for 66 6d 74 20
D:\AP\audio-utils\windows\sox\sox.exe DBUG wav: WAV Chunk fmt 
D:\AP\audio-utils\windows\sox\sox.exe DBUG wav: Searching for 64 61 74 61
D:\AP\audio-utils\windows\sox\sox.exe DBUG wav: WAV Chunk data
D:\AP\audio-utils\windows\sox\sox.exe DBUG wav: Reading Wave file: Microsoft PCM format, 2 channels, 16000 samp/sec
D:\AP\audio-utils\windows\sox\sox.exe DBUG wav:         64000 byte/sec, 4 block align, 16 bits/samp, 302054632 data bytes
D:\AP\audio-utils\windows\sox\sox.exe DBUG wav:         75513658 Samps/chans
D:\AP\audio-utils\windows\sox\sox.exe DBUG wav: Searching for 4c 49 53 54
D:\AP\audio-utils\windows\sox\sox.exe FAIL trim: Error parsing position 2
D:\AP\audio-utils\windows\sox\sox.exe FAIL trim: usage: {position}


No standard output

2019-06-25T10:06:01.8565896-03:00 [1] FATAL LogFileOnly - Unhandled exception ->

Acoustics.Tools.Audio.AudioUtilityException: Failed to execute process: exit code was `1`. `D:\AP\audio-utils\windows\sox\sox.exe` ` -R  -q -V4 "D:\Tesis\DSC\AP_analysis\Mixdown1.1hs.wav" -t wavpcm 

The comma in the SoX command is probably the issue. The error was reported by @tinchobulen who uses an Argentinian locale.

Expected behaviour

When we format numbers for CLI tools to use, the should be formatted with the culture invariant culture.

Diagnostics

  • I Confirm I have followed the instructions for reporting a bug
  • I have attached a log: see excerpt above
  • I have answered the following questions:
    • Operating system: Windows 7 Ultimate
    • AP.exe version: v19.5.0.1
    • The data used can be found:
    • The command I used:

in Power Shell:

D:\AP\AnalysisPrograms.exe audio2csv D:\Tesis\DCS\AP_analysis\Mixdown1.1hs.wav Towsey.Acoustic.yml D:\Tesis\DCS\results_AP.exe

Screenshots

Additional Details

@atruskie atruskie added the bug label Jun 26, 2019
@atruskie atruskie self-assigned this Jun 26, 2019
@atruskie
Copy link
Member Author

Originally raised in #241

atruskie added a commit that referenced this issue Jun 27, 2019
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
atruskie added a commit that referenced this issue Jun 28, 2019
* 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
@tinchobulen
Copy link

Sure @atruskie! sorry for that.

please find attached the log file from the new version of AP.exe.

Tried with R.

log_20190701T150843Z.txt

Martín.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants