1d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch/*
2d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch * Copyright (C) 2016 The Android Open Source Project
3d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch *
4d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch * Licensed under the Apache License, Version 2.0 (the "License");
5d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch * you may not use this file except in compliance with the License.
6d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch * You may obtain a copy of the License at
7d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch *
8d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch *      http://www.apache.org/licenses/LICENSE-2.0
9d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch *
10d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch * Unless required by applicable law or agreed to in writing, software
11d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch * distributed under the License is distributed on an "AS IS" BASIS,
12d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch * See the License for the specific language governing permissions and
14d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch * limitations under the License.
15d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch *
16d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch */
17d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch
18d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch#ifndef AUDIOPLAY_H_
19d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch#define AUDIOPLAY_H_
20d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch
21d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch#include <string.h>
22d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch
23d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitschnamespace audioplay {
24d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch
25a91a2d737586ebd0040129333055d8093899751bGeoffrey Pitsch// Initializes the engine with an example of the type of WAV clip to play.
26a91a2d737586ebd0040129333055d8093899751bGeoffrey Pitsch// All buffers passed to playClip are assumed to be in the same format.
27a91a2d737586ebd0040129333055d8093899751bGeoffrey Pitschbool create(const uint8_t* exampleClipBuf, int exampleClipBufSize);
28d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch
29a91a2d737586ebd0040129333055d8093899751bGeoffrey Pitsch// Plays a WAV contained in buf.
30a91a2d737586ebd0040129333055d8093899751bGeoffrey Pitsch// Should not be called while a clip is still playing.
31d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitschbool playClip(const uint8_t* buf, int size);
32d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitschvoid setPlaying(bool isPlaying);
33d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitschvoid destroy();
34d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch
35d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch}
36d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch
37d6d9a1d0b9cf6fa740d9fe410015b094475c5a4cGeoffrey Pitsch#endif // AUDIOPLAY_H_
38