How to get the default info Eg sample freq etc etc

Annex for ESP32
charlie
Posts: 39
Joined: Thu Jul 28, 2022 11:36 am
Location: MANTOVA ITALY
Been thanked: 3 times
Contact:

How to get the default info Eg sample freq etc etc

Post by charlie »

PLAY.SETUP 0
PLAY.WAV /"pianobb_A#_major.wav"
when I run, a message "type mismatch at line2 "= is generated.

Charlie.
User avatar
cicciocb
Site Admin
Posts: 1900
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 407 times
Been thanked: 1269 times
Contact:

Re: How to get the default info Eg sample freq etc etc

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Thu Jul 28, 2022 2:44 pm PLAY.SETUP 0
PLAY.WAV /"pianobb_A#_major.wav"
when I run, a message "type mismatch at line2 "= is generated.

Charlie.
There is a syntax error in your line as it should be

Code: [Local Link Removed for Guests]

PLAY.WAV "/pianobb_A#_major.wav"
Try to avoid also the use of the # character, maybe it could be also the cause of the problem
AndyGadget
Posts: 222
Joined: Mon Feb 15, 2021 1:44 pm
Has thanked: 120 times
Been thanked: 132 times

Re: How to get the default info Eg sample freq etc etc

Post by AndyGadget »

Hey Charlie if you're doing what it looks like you're doing, you may want to look into doing it with Mellotron samples as well.
They're available as WAV or MP3 files if you know where to look :D
charlie
Posts: 39
Joined: Thu Jul 28, 2022 11:36 am
Location: MANTOVA ITALY
Been thanked: 3 times
Contact:

Re: How to get the default info Eg sample freq etc etc

Post by charlie »

Hi cicciocb, moving the slash as you suggest, I have another error

PLAY.SETUP 0,32
PLAY.WAV "/piano-c_C_major.wav"
PLAY.STOP
END

file not found line 2

Charlie

NB the files are in the default position (parent directory) PATH:/html
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: How to get the default info Eg sample freq etc etc

Post by Electroguard »

You shouldn't include math operators or special characters in a filename - they can be ignored as invalid, or interpreted as instructions for special operations.

Start by using a simple filename with standard alphabetic characters to prove file access, then you can rename to suit 1 character at a time to trap any problems en-route.

And the example at the bottom includes exactly the same error as before ... /"
You need to modify ALL file references to "/
charlie
Posts: 39
Joined: Thu Jul 28, 2022 11:36 am
Location: MANTOVA ITALY
Been thanked: 3 times
Contact:

Re: How to get the default info Eg sample freq etc etc

Post by charlie »

HI, I try every combination this is the last text based on your suggestion. Always "file not found at line 2"

PLAY.SETUP 0,32
PLAY.MP3 "/Jon_AndersonHold_On_To_Love.mp3"
PLAY.STOP

PLAY.SETUP 0,32
PLAY.WAV "/pianoc_C_major.wav"
PLAY.STOP
END
User avatar
cicciocb
Site Admin
Posts: 1900
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 407 times
Been thanked: 1269 times
Contact:

Re: How to get the default info Eg sample freq etc etc

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat Jul 30, 2022 10:19 am HI, I try every combination this is the last text based on your suggestion. Always "file not found at line 2"

PLAY.SETUP 0,32
PLAY.MP3 "/Jon_AndersonHold_On_To_Love.mp3"
PLAY.STOP

PLAY.SETUP 0,32
PLAY.WAV "/pianoc_C_major.wav"
PLAY.STOP
END
Hi,
can you just do a screen copy of the file manager page of your module?
(Like this page below)
image.png
You do not have the required permissions to view the files attached to this post.
charlie
Posts: 39
Joined: Thu Jul 28, 2022 11:36 am
Location: MANTOVA ITALY
Been thanked: 3 times
Contact:

Re: How to get the default info Eg sample freq etc etc

Post by charlie »

Picture.png
You do not have the required permissions to view the files attached to this post.
charlie
Posts: 39
Joined: Thu Jul 28, 2022 11:36 am
Location: MANTOVA ITALY
Been thanked: 3 times
Contact:

Re: How to get the default info Eg sample freq etc etc

Post by charlie »

Do you see??? This is the MOST difficult Forum of my life!!!!
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: How to get the default info Eg sample freq etc etc

Post by Electroguard »

Yes, you do seem to be having trouble making sense of the Forum Charlie.
It doesn't help that you seem to have pasted misleading info into your profile signature so that it appears at the bottom of all your posts.
So lets take a deep breath, and start again on a firm base.

Annex uses 'root-relative' addressing for files that your script needs to access.
That is irrespective of where your script is actually located and being RUN from.
Running your script from within "/programs" folder does not mean it can access files in that folder without pre-fixing files with their root-relative path.
So files that are in the root need to be addressed by prefixing them with the '/' character as part of their name, eg: "/filename".
Files that are in a subfolder need to be addressed by prefixing them with '/folder/', then add the filename, eg: "/folder/filename".

Your screendump was nothing to do with the Forum, that was purely down to your ability to take a screendump picture.
However, the picture shows that you were in the 'programs' folder instead of the root where your required files are apparently located.
And unfortunately you had not scrolled down the window sufficiently to show the appropriate filename(s) in your screendump anyway.

It obviously helps us to help others if they supply their full script, which will undoubtedly be where the problem lies.
And without even a useful screendump of the appropriate files in the appropriate folder we don't have any relevant information to be able to help you with your actual problem - therefore I can only offer some general advice:

Put ALL relevant files in the root, including your script (just SAVE it as /scriptname)
Ensure that all references to files in the script use "/filename"
Post Reply