I need to be able to run a .mp3 file using Java, I tried this, but to no avail:
Process process = new ProcessBuilder("C:\\Users\\<removed>\\Desktop\\Music\\Cash Cash\\Overtime.mp3")
and then run
process.start();
But this causes this error:
java.io.IOException: Cannot run program "C:\Users\<removed>\Desktop\Music\Cash Cash\Overtime.mp3": CreateProcess error=193, %1 is not a valid Win32 application at java.lang.ProcessBuilder.start(Unknown Source) at com.newgarbo.music.Mooseec.main(Mooseec.java:50) Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 2 more
I guess this is, of course, because Process is only for / jars executables, and if so, can someone show me a way to run these files? ^ _ ^
java audio
bernhardkiv
source share