complier messages with Audio.h lib

I am new to programming and Arduino. Please bear with me. I have a simple sketch I am trying to compile and I get a mountain of error messages. I don't have the knowledge yet to understand what they mean so I am a bit stuck. Any help is much appreciated!

#include <Audio.h>



#include <dac.h>   // note: does not compile with or without this file

#include <SPI.h>   // note: does not compile with or without this file

#include <SD.h>    // note: does not compile with or without this file





void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

And here is the error the compiler gives:

In file included from C:\Arduino_ready_to_prg\libraries\MY_AUDIO/Audio.h:16:0,

                 from C:\Arduino_ready_to_prg\TESTSKCH\TESTSKCH.ino:4:

C:\Arduino_ready_to_prg\libraries\MY_AUDIO/DAC.h:21:16: error: expected ')' before '*' token

  DACClass(Dacc *_dac, uint32_t _dacId, IRQn_Type _isrId) :

                ^

C:\Arduino_ready_to_prg\libraries\MY_AUDIO/DAC.h:35:2: error: 'Dacc' does not name a type

  Dacc *dac;

  ^

C:\Arduino_ready_to_prg\libraries\MY_AUDIO/DAC.h:37:2: error: 'IRQn_Type' does not name a type

  IRQn_Type isrId;

  ^

C:\Arduino_ready_to_prg\libraries\MY_AUDIO/DAC.h: In member function 'void DACClass::enableInterrupts()':

C:\Arduino_ready_to_prg\libraries\MY_AUDIO/DAC.h:31:44: error: 'isrId' was not declared in this scope

  void enableInterrupts()  { NVIC_EnableIRQ(isrId); };

                                            ^

C:\Arduino_ready_to_prg\libraries\MY_AUDIO/DAC.h:31:49: error: 'NVIC_EnableIRQ' was not declared in this scope

  void enableInterrupts()  { NVIC_EnableIRQ(isrId); };

                                                 ^

C:\Arduino_ready_to_prg\libraries\MY_AUDIO/DAC.h: In member function 'void DACClass::disableInterrupts()':

C:\Arduino_ready_to_prg\libraries\MY_AUDIO/DAC.h:32:45: error: 'isrId' was not declared in this scope

  void disableInterrupts() { NVIC_DisableIRQ(isrId); };

                                             ^

C:\Arduino_ready_to_prg\libraries\MY_AUDIO/DAC.h:32:50: error: 'NVIC_DisableIRQ' was not declared in this scope

  void disableInterrupts() { NVIC_DisableIRQ(isrId); };

                                                  ^

exit status 1
Error compiling for board Arduino/Genuino Uno.

error_message.txt (1.72 KB)

Where did you get the Audio.h file?

Please enlighten us where those first two libraries (audio and dac) can be found.

On the internet. Google "arduino audio.h" and the sites will pop up

On the internet. Google "arduino audio.h" and the sites will pop up

Which one of us should do that? Which one of us needs help?

I am not sure what your asking. I downloaded it from a site, as to which one out of all that came up from Google I am not sure. I think it was "github" but I am not certain.

There is a demo program right here on arduino.cc https://www.arduino.cc/en/Tutorial/SimpleAudioPlayer to play these files. The sketch requires the "audio.h" file, thus I went in search of such a file on the internet.

I am sorry if I do not have the level of understanding in electronics as you have. I am new to this and trying to learn on my own with no one physically around to help. My understanding is Arduino is "electronics for the non-technical" ... there will obviously be gaps in a beginner's understanding.

If you can help me that would be great.

Hi,

They're asking why you are making them do the Google search when you are the one asking for help.

Have you installed the libraries mentioned? Specifically how/where?

Were you consistent with capitalization? "DAC.h" vs "dac.h"?

"audio.h" is for the Due. Which Arduino board are you trying to use?

--Michael

Can you enable verbose mode when compiling? Use File + Preferences. Post the complete output.

Michael: Thank you. I am using an Uno R3. The files are installed correctly in the library directory. Files names (caps and all) are now exactly as called for in sketch... still a mass or errors given on compile.

I kept the sketch super small so that what ever root cause will not be masked by my program.

Can I assume my problem is due to my using an Uno and not a Due?

Thank you again.

Can I assume my problem is due to my using an Uno and not a Due?

Yes.

Thank you all. That answers my problem... The documentation said Due but not only Due... so I tried with a Uno. I will assume for now on if the example is Due, or Leonardo or what ever it is exclusive to that board unless otherwise specified. Thank you again for all your help!

Now... is there a simple Uno based version? I came across a WAV file simple demo but not a MP3 simple demo. Thank you in advance again.

The Due in particular is a different kind of processor compared to Uno/Pro Micro/Leonardo/Pro Mini/Nano etc. The Due is a 32 bit Arm with a number of built-in peripherals; the others are much simpler 8 bit AVRs.

--Michael

Michael: This answers more questions than the one I posted. There are other mini projects I did to learn (Wireless, etc) where the documentation never explicitly stated "will not work for Uno" and I had similar problems, often solved by finding other libs that did work in the end... not I have an explanation of the situations and a caution going forward. Thanks you all very much again!

You're welcome.

Note that there are some differences among the 8-bit AVRs as well, though they're mostly similar in capability. You might have to do a little research before using them, depending.

--Michael

Whats an "AVR"...

Are there any good book specific to Arduino that goes through all these hidden "Easter Eggs" people like me don't know about? There is a lot more to Adruino than just while and for loops and such. I wish there was a one-stop "course" I can do that will cover everything in the IDE and the language.

Well, it's as deep as you want to dive.
A good place to start is this site:
www.arduino.cc/en/Main/Products
Follow the links. (Though I notice an error. The Pro Mini doesn't belong in the "Enhanced Features" category.) Each one is a tool with qualities that makes it suitable for various purposes.

Most basic tutorial's are written for the Uno. Most of these will also run on many other Arduino platforms. If a tutorial or example is for a specific platform, and it's written in a competent way, that will be specified somewhere.

I started learning by working my way through the first several of these tutorials:
learn.adafruit.com/adafruit-arduino-lesson-1-blink
And then branching out to follow the things I wanted to try, inspired by a lot of general reading, mainly on the web.

Look at the head of this forum:
forum.arduino.cc/index.php?topic=384198.0

Read the datasheet for the processor used in the Uno and a few other Arduino models:
www.atmel.com/images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Complete.pdf
(It's deep wading, I admit.)

Paths lead out from the Uno. Smaller, bigger, more I/O, more memory, faster, with various capabilities built into their hardware. The language for all of them is C/C++
www.learncpp.com/

And keep in mind, the whole method is what I like to think of as "failing your way to success." Try something (the Arduino platform is brilliant for quickly trying simple ideas) and then come up with a theory for why it didn't do what you hoped. Proceed systematically.

Some people call this fun.

Best,
Michael

Thank you Michael and everyone else for the help!