16

Is it possible to run a .exe file in Ubuntu in a script? For example a simple Matlab code like this:

system("dir/WAV2RAW.exe")
Melebius
  • 11,431
  • 9
  • 52
  • 78
ASAD
  • 489
  • 1
    If the .exe file is a windows executeable, you can't run it directly in Ubuntu (or other Linux's). Either you should install Wine and run it through that, or find a utility in Ubuntu that does the same as the windows one. – Soren A Jan 24 '18 at 08:56
  • 7
    Could be a slight case of the XY-problem (https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem)... If you want to convert a wav-file to raw PCM data for processing in Matlab, you could use a linux-tool like sox instead: https://stackoverflow.com/questions/9383576/how-to-convert-16bit-wav-to-raw-audio – Manawyrm Jan 24 '18 at 10:57
  • Is WAV2RAW.exe the only EXE program you want to run, or do you have several other DOS / Windows / .NET programs? – dcorking Jan 24 '18 at 11:25
  • 1
    I'm relatively sure that Matlab (and its open-source clone Octave) have native functions to parse WAVE headers and data as well as to write raw PCM data since I used them in the past. Those would obviate the need for an external conversion application unless the PCM data doesn't fit into main memory. – David Foerster Jan 24 '18 at 12:48

2 Answers2

35

I think you should use Wine.

sudo apt-get install wine
wine dir/WAV2RAW.exe

Or Mono if you know that exe is .NET application:

sudo apt install mono-runtime
mono dir/WAV2RAW.exe
N0rbert
  • 99,918
4

As mentioned in the comments this may be an XY problem

You could use 'sox' to convert from raw to wav file types:

sudo apt install sox

will install the program, then

sox --type raw <infile> --type wav <outfile>

would perform a simple conversion from the raw to wav formats

Charles Green
  • 21,339