Skip to content

Commit fb4f00e

Browse files
committed
AudioKitHAL
1 parent 437e596 commit fb4f00e

File tree

8 files changed

+26
-20
lines changed

8 files changed

+26
-20
lines changed

examples/examples-audiokit/basic-a2dp-audiokit/basic-a2dp-audiokit.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define USE_A2DP
22
#include "AudioTools.h"
3-
#include "AudioLibs/AudioKitHAL.h"
3+
#include "AudioLibs/AudioKit.h"
44

55

66
BluetoothA2DPSink a2dp_sink;

examples/examples-audiokit/player-sd-audiokit/player-sd-audiokit.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#define USE_SDFAT
1111
#define USE_HELIX
1212
#include "AudioTools.h"
13-
#include "AudioLibs/AudioKitHAL.h"
13+
#include "AudioLibs/AudioKit.h"
1414

1515
using namespace audio_tools;
1616

examples/examples-audiokit/player-url_icy-audiokit/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ You dont need to bother about any wires because everything is on one nice board.
88

99
I also demonstrate how to assign your own actions to the buttons of the audio kit.
1010

11-
### Note
11+
### Notes
1212

13-
The log level has been set to Info to help you to identify any problems. Please change it to AudioLogger::Warning to get the best sound quality!
13+
- Do not forget to set the wifi name and password.
14+
- The log level has been set to Info to help you to identify any problems. Please change it to AudioLogger::Warning to get the best sound quality!
1415

1516

1617
### Dependencies

examples/examples-audiokit/player-url_icy-audiokit/player-url_icy-audiokit.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include "AudioTools.h"
1313
#include "AudioCodecs/CodecMP3Helix.h"
14-
#include "AudioLibs/AudioKitHAL.h"
14+
#include "AudioLibs/AudioKit.h"
1515

1616
using namespace audio_tools;
1717

examples/examples-audiokit/streams-audiokit-csv/streams-audiokit-csv.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
#include "AudioTools.h"
12-
#include "AudioLibs/AudioKitHAL.h"
12+
#include "AudioLibs/AudioKit.h"
1313

1414
using namespace audio_tools;
1515

examples/examples-audiokit/streams-flite-audiokit/streams-flite-audiokit.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "flite_arduino.h"
1010
#include "AudioTools.h"
11-
#include "AudioLibs/AudioKitHAL.h"
11+
#include "AudioLibs/AudioKit.h"
1212

1313
using namespace audio_tools;
1414

examples/examples-audiokit/streams-pins-audiokit/streams-pins-audiokit.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
#include "AudioTools.h"
10-
#include "AudioLibs/AudioKitHAL.h"
10+
#include "AudioLibs/AudioKit.h"
1111
#include "flite_arduino.h"
1212

1313
using namespace audio_tools;

src/AudioLibs/AudioKitHAL.h renamed to src/AudioLibs/AudioKit.h

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#pragma once
22

3-
#include "AudioKit.h"
3+
#include "AudioKitHAL.h"
44
#include "AudioTools/AudioActions.h"
55

6-
#define KEY_RESPONSE_TIME_MS 10
7-
86
namespace audio_tools {
97

108
class AudioKitStream;
@@ -231,7 +229,10 @@ class AudioKitStream : public AudioStreamX {
231229
bool setMute(bool mute) { return kit.setMute(mute); }
232230

233231
/// Defines the Volume
234-
bool setVolume(int vol) { return kit.setVolume(vol); }
232+
bool setVolume(int vol) {
233+
volume_value = vol;
234+
return kit.setVolume(vol);
235+
}
235236

236237
/// Determines the volume
237238
int volume() { return kit.volume(); }
@@ -241,13 +242,8 @@ class AudioKitStream : public AudioStreamX {
241242
*
242243
*/
243244
void processActions() {
244-
// LOGI(LOG_METHOD);
245-
// static unsigned long keys_timeout = 0;
246-
// if (keys_timeout < millis()) {
247-
// LOGD(LOG_METHOD);
245+
// LOGD(LOG_METHOD);
248246
actions.processActions();
249-
// keys_timeout = millis() + KEY_RESPONSE_TIME_MS;
250-
// }
251247
delay(1);
252248
}
253249

@@ -263,7 +259,16 @@ class AudioKitStream : public AudioStreamX {
263259
actions.add(pin, action);
264260
}
265261

266-
void incrementVolume(int vol) { volume_value += vol; }
262+
/**
263+
* @brief Relative volume control
264+
*
265+
* @param vol
266+
*/
267+
void incrementVolume(int vol) {
268+
volume_value += vol;
269+
LOGI("incrementVolume: %d -> %d",vol, volume_value);
270+
kit.setVolume(volume_value);
271+
}
267272

268273
/**
269274
* @brief Increase the volume
@@ -437,7 +442,7 @@ class AudioKitStream : public AudioStreamX {
437442
AudioKit kit;
438443
AudioKitStreamConfig cfg;
439444
AudioActions actions;
440-
int volume_value = 20;
445+
int volume_value = 40;
441446
bool active = true;
442447
// channel and sample size conversion support
443448
AudioKitStreamAdapter kit_stream = AudioKitStreamAdapter(&kit);

0 commit comments

Comments
 (0)