gatech-csl / jes

The Jython Environment for Students allows students to write Jython programs that can manipulate pictures, sounds, and videos.
http://mediacomputation.org/
60 stars 39 forks source link

Sound files won't pass to funtions #93

Open stvstreet7 opened 9 years ago

stvstreet7 commented 9 years ago

Hello there, I've been working on Program 5 in chapter 2 of "Introduction to computing and programming in Python." However, there seems to be a problem using sound files that results in a strange error message. Here is the code I typed:

def playNamed(myFile): mySound = makeSound(myFile) play (mySound)

After saving and loading the file I typed the following into the command window:

playNamed("C:\Users\Steve\RMIT\SP4 2015\CPT120\mediasources-4ed\mediasources-4ed\airplane.wav")

I then get the following error message:

There is no file at C:\Users\Steve\RMIT\SP4 2015\CPT120\mediasources-4ed\mediasources-4edirplane.wav The error value is: Inappropriate argument value (of correct type). An error occurred attempting to pass an argument to a function. Please check line 2 of C:\Users\Steve\RMIT\SP4 2015\CPT120\Txt_Bk_Chp_2\Code\playNamed.py

I used copy/paste from the command window to make sure I had the correct filename, but it appears that part of the filename is missing from the error message (the '\a' is missing from 'airplane.wav' at the end of the filename in the error message). This error message occurs when I use other .wav files too. However, the same problem does not occur with JPEG files. Any help would be greatly appreciated. The JES version details I'm using are outlined below.

JES version 5.020 Release date: May 11, 2015 Source control: Git commit 56b6799 (Mon, 11 May 2015 16:01:16 -0400) Java version: 1.6.0_20 (Java(TM) SE Runtime Environment/Java HotSpot(TM) Client VM) Jython version: 2.5.3 (build 2.5:c56500f08d34+, Aug 13 2012, 14:48:36) Computer OS: Windows 7 (x86 architecture)

Best wishes, Steve

mjguzdial commented 9 years ago

Sorry I missed this last time. Put an "r" in front of the string, e.g.,

playNamed(r"C:\Users\Steve\RMIT\SP4 2015\CPT120\mediasources-4ed\mediasources-4ed\airplane.wav")

See top of page 67 in the book. The backslash characters are being interpreted as other characters, which makes the filename invalid, so you don't actually create the sound.


From: stvstreet7 notifications@github.com Sent: Tuesday, November 17, 2015 4:13 AM To: gatech-csl/jes Subject: [jes] Sound files won't pass to funtions (#93)

Hello there, I've been working on Program 5 in chapter 2 of "Introduction to computing and programming in Python." However, there seems to be a problem using sound files that results in a strange error message. Here is the code I typed:

def playNamed(myFile): mySound = makeSound(myFile) play (mySound)

After saving and loading the file I typed the following into the command window:

playNamed("C:\Users\Steve\RMIT\SP4 2015\CPT120\mediasources-4ed\mediasources-4ed\airplane.wav")

I then get the following error message:

There is no file at C:\Users\Steve\RMIT\SP4 2015\CPT120\mediasources-4ed\mediasources-4ed?irplane.wav The error value is: Inappropriate argument value (of correct type). An error occurred attempting to pass an argument to a function. Please check line 2 of C:\Users\Steve\RMIT\SP4 2015\CPT120\Txt_Bk_Chp_2\Code\playNamed.py

I used copy/paste from the command window to make sure I had the correct filename, but it appears that part of the filename is missing from the error message (the '\a' is missing from 'airplane.wav' at the end of the filename in the error message). This error message occurs when I use other .wav files too. However, the same problem does not occur with JPEG files. Any help would be greatly appreciated. The JES version details I'm using are outlined below.

JES version 5.020 Release date: May 11, 2015 Source control: Git commit 56b6799https://github.com/gatech-csl/jes/commit/56b6799919f7d1107969ff534b81bb3b29ef999b (Mon, 11 May 2015 16:01:16 -0400) Java version: 1.6.0_20 (Java(TM) SE Runtime Environment/Java HotSpot(TM) Client VM) Jython version: 2.5.3 (build 2.5:c56500f08d34+, Aug 13 2012, 14:48:36) Computer OS: Windows 7 (x86 architecture)

Best wishes, Steve

Reply to this email directly or view it on GitHubhttps://github.com/gatech-csl/jes/issues/93.

stvstreet7 commented 9 years ago

Thanks Mark,

Greatly appreciated!

Best wishes,

Steve Street, PhD

On 25 Nov 2015, at 11:05 PM, mjguzdial notifications@github.com wrote:

Sorry I missed this last time. Put an "r" in front of the string, e.g.,

playNamed(r"C:\Users\Steve\RMIT\SP4 2015\CPT120\mediasources-4ed\mediasources-4ed\airplane.wav")

See top of page 67 in the book. The backslash characters are being interpreted as other characters, which makes the filename invalid, so you don't actually create the sound.

  • Mark

From: stvstreet7 notifications@github.com Sent: Tuesday, November 17, 2015 4:13 AM To: gatech-csl/jes Subject: [jes] Sound files won't pass to funtions (#93)

Hello there, I've been working on Program 5 in chapter 2 of "Introduction to computing and programming in Python." However, there seems to be a problem using sound files that results in a strange error message. Here is the code I typed:

def playNamed(myFile): mySound = makeSound(myFile) play (mySound)

After saving and loading the file I typed the following into the command window:

playNamed("C:\Users\Steve\RMIT\SP4 2015\CPT120\mediasources-4ed\mediasources-4ed\airplane.wav")

I then get the following error message:

There is no file at C:\Users\Steve\RMIT\SP4 2015\CPT120\mediasources-4ed\mediasources-4ed?irplane.wav The error value is: Inappropriate argument value (of correct type). An error occurred attempting to pass an argument to a function. Please check line 2 of C:\Users\Steve\RMIT\SP4 2015\CPT120\Txt_Bk_Chp_2\Code\playNamed.py

I used copy/paste from the command window to make sure I had the correct filename, but it appears that part of the filename is missing from the error message (the '\a' is missing from 'airplane.wav' at the end of the filename in the error message). This error message occurs when I use other .wav files too. However, the same problem does not occur with JPEG files. Any help would be greatly appreciated. The JES version details I'm using are outlined below.

JES version 5.020 Release date: May 11, 2015 Source control: Git commit 56b6799https://github.com/gatech-csl/jes/commit/56b6799919f7d1107969ff534b81bb3b29ef999b (Mon, 11 May 2015 16:01:16 -0400) Java version: 1.6.0_20 (Java(TM) SE Runtime Environment/Java HotSpot(TM) Client VM) Jython version: 2.5.3 (build 2.5:c56500f08d34+, Aug 13 2012, 14:48:36) Computer OS: Windows 7 (x86 architecture)

Best wishes, Steve

Reply to this email directly or view it on GitHubhttps://github.com/gatech-csl/jes/issues/93. — Reply to this email directly or view it on GitHub.

ChristianRonald commented 6 years ago

Hi, I don't can open audio's file, when I try it, give this :

The error was: Exception during load of file C:\Users\USER\Desktop.........wma Please ensure this file exists and uses a filetype supported by JES (wav, aiff, au). A Python SoundException happened while running your program, so it stopped. SoundException: Exception during load of file C:\Users\USER\Desktop\17 Una Mujer de Bandera.wma Please ensure this file exists and uses a filetype supported by JES (wav, aiff, au).

Please help me! thanks

mjguzdial commented 6 years ago

WMA files are not supported. See the error message for which audio file types are supported.

Sent from my iPhone

On Jun 21, 2018, at 9:23 PM, ChristianRonald notifications@github.com<mailto:notifications@github.com> wrote:

Hi, I don't can open audio's file, when I try it, give this :

The error was: Exception during load of file C:\Users\USER\Desktop.........wma Please ensure this file exists and uses a filetype supported by JES (wav, aiff, au). A Python SoundException happened while running your program, so it stopped. SoundException: Exception during load of file C:\Users\USER\Desktop\17 Una Mujer de Bandera.wma Please ensure this file exists and uses a filetype supported by JES (wav, aiff, au).

Please help me! thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/gatech-csl/jes/issues/93#issuecomment-399215214, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AELfpt1bxg1419xxCp9mk3DqkgHuMJAWks5t-_KxgaJpZM4GjqmR.

ChristianRonald commented 6 years ago

Thanks Mark

I am very grateful