Waveform analysis/Top and tail: Difference between revisions

m
m (syntax highlighting fixup automation)
m (→‎{{header|Wren}}: Minor tidy)
 
Line 400:
{{trans|Go}}
The ability to call external processes such as ''SoX'' is expected to be added to Wren-cli in the next release. In the meantime, we embed the following Wren script in a C host to complete this task.
<syntaxhighlight lang="ecmascriptwren">/* waveform_analysis_top_and_tailWaveform_analysis_Top_and_tail.wren */
 
class C {
Line 455:
<br>
We now embed this in the following C program, compile and run it.
<syntaxhighlight lang="c">#include/* <stdiogcc Waveform_analysis_Top_and_tail.h>c -o Waveform_analysis_Top_and_tail -lwren -lm */
 
#include <stdio.h>
#include <stdio_ext.h>
#include <stdlib.h>
Line 537 ⟶ 539:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "waveform_analysis_top_and_tailWaveform_analysis_Top_and_tail.wren";
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
9,476

edits