1
0
Fork
You've already forked video_export_processing
0

Example withAudioViz: Parsed values have wrong decimal point #43

Closed
opened 2017年10月22日 17:09:52 +02:00 by ptoews · 0 comments
ptoews commented 2017年10月22日 17:09:52 +02:00 (Migrated from github.com)
Copy link

I copied your example for creating a visualization for a sound file but it didn't work. I figured out that's because of the use of the Processing function nf() in the lines below, that uses (in my case) the comma as a decimal point for formatting.

StringBuilder msg = new StringBuilder(nf(chunkStartIndex/sampleRate, 0, 3));
 for (int i=0; i<fftSlices; ++i) {
 msg.append(SEP + nf(fftL.getAvg(i), 0, 4));
 msg.append(SEP + nf(fftR.getAvg(i), 0, 4));
 }

These values are then saved to the text file that gets parsed again with Processing's float(), which converts them to NaN since it doesn't recognize the comma as the decimal point.

I copied your example for creating a visualization for a sound file but it didn't work. I figured out that's because of the use of the Processing function `nf()` in the lines below, that uses (in my case) the comma as a decimal point for formatting. ``` StringBuilder msg = new StringBuilder(nf(chunkStartIndex/sampleRate, 0, 3)); for (int i=0; i<fftSlices; ++i) { msg.append(SEP + nf(fftL.getAvg(i), 0, 4)); msg.append(SEP + nf(fftR.getAvg(i), 0, 4)); } ``` These values are then saved to the text file that gets parsed again with Processing's `float()`, which converts them to NaN since it doesn't recognize the comma as the decimal point.
Sign in to join this conversation.
No Branch/Tag specified
master
kotlinGradle
v23
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hamoid/video_export_processing#43
Reference in a new issue
hamoid/video_export_processing
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?