How To fix 'No Matching function for call'

#include <SD.h>
#include <SPI.h>
#include <Audio.h>

void setup() {
// debug output at 9600 baud
Serial.begin(9600);

// setup SD-card
Serial.print("Initializing SD card...");
if (!SD.begin(4)) {
Serial.println(" failed!");
while(true);
}
Serial.println(" done.");
// hi-speed SPI transfers

// 44100kHz stereo => 88200 sample rate
// 100 mSec of prebuffering.
Audio.begin(88200, 100);
}

void loop() {
int count = 0;

// open wave mp3 from sdcard
File myFile = SD.open("82.wav");
if (!myFile) {
// if the file didn't open, print an error and stop
Serial.println("error opening 82.wav");
while (true);
}

const int S = 1024; // Number of samples to read in block
short buffer~~;~~
~~ Serial.print("Playing");~~
~~ // until the file is not finished~~
~~ while (myFile.available()) {~~
~~ // read from the file into buffer~~
~~ myFile.read(buffer, sizeof(buffer));~~
~~ // Prepare samples~~
~~ int volume = 1024;~~
~~ Audio.prepare(buffer, S, volume);~~
~~ // Feed samples to audio~~
~~ ;~~
Audio.write(buffer, S);
~~ // Every 100 block print a '.'~~
~~ count++;~~
~~ if (count == 100) {~~
~~ Serial.print(".");~~
~~ count = 0;~~
~~ }~~
~~ }~~
~~ myFile.close();~~
~~ Serial.println("End of file. Thank you for listening!");~~
~~ while (true) ;~~
}

https://forum.arduino.cc/index.php?topic=97455.0

Is this using the "Audio" library shown as "Compatible with Arduino Due only"?!?

You have two threads with the same visual problem; why is your code partially striked through :wink:

Please read How to use this forum - please read.; pay special attention at point 7 that describes how to properly post code.

sterretje probably knows this already, but in case anyone wonders...

The variable "buffer" is probably an array. The definition probably uses [S] which, without the recommended code tags, becomes a command to begin using strikethrough font.

Basically, this shows that the post comes from someone who ignores or has not read the locked posts at the top of the forum that explain how to post.

I suspected it but I had to quote the post to see it :slight_smile: