# NetSpeaker

[![License: Unlicense](https://img.shields.io/badge/License-Unlicense-blue.svg?style=for-the-badge)](https://unlicense.org/)
[![Open Source](https://img.shields.io/badge/Open_Source-gray?style=for-the-badge&logo=opensourceinitiative&logoColor=3DA639)](https://opensource.org/)
[![ESP32](https://img.shields.io/badge/ESP32-FCC624?style=for-the-badge&logo=esphome&logoColor=black)](https://www.espressif.com/en/products/socs/esp32)
[![State: Unstable](https://img.shields.io/badge/State-Unstable-red.svg?style=for-the-badge)]()


NetSpeaker is a project that aims to make it easier to build your own sound system, just like sqeezebox, for example.

There are two operating modes, to adapt to the specific use case - default mode is 0. The mode can be set at compile time
via the constant operation_mode. Valid choices are:

- 0: interconnected (HTTP API and WiFi, no buttons); useful for bigger projects
- 1: standalone (Buttons, no WiFi and HTTP API); useful if you want to build a small player


## Roadmap

Features, already implemented, or still in progress for the v1.0.0 release!

- [x] SD card support for playing audio files
- [x] Two operating modes, standalone mode fully implemented
- [x] API in mode 0
- [x] API methods:
    - [X] /api/v1/playback/toggle
    - [X] /api/v1/playback/play
    - [X] /api/v1/playback/pause
    - [X] /api/v1/playback/next
    - [X] /api/v1/playback/previous
    - [X] /api/v1/playback/info
    - [ ] /api/v1/playback/id3_image
    - [X] /api/v1/playlist/get
    - [ ] /api/v1/playlist/append
    - [ ] /api/v1/playlist/remove
    - [X] /api/v1/volume/get
    - [X] /api/v1/volume/up
    - [X] /api/v1/volume/down
    - [X] /api/v1/volume/mute
    - [X] /api/v1/volume/<0-20>
    - [X] /api/v1/settings/restart/
- [X] Automatic WiFi connection
- [X] Access Point opened when no WiFi connection could be established
- [ ] Implement a configuration server running on port 8080
    - [ ] Edit wifi connection
    - [ ] Edit friendly name of the NetSpeaker
- [ ] Implement file upload
- [ ] Get all files of the SD card via API
- [ ] Implement a real mute function
- [X] Improve the volume endpoint handler (currently pretty undynamic)


## Credits

Thanks to...

- the makers of Arduino IDE
- schreibfaul1 (github) for creating the audio library used in this project
- espressif for making the best microprocessor I've ever seen


## Contributing

Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change. 
Please also make sure to test things carefully before contributing them.

## Mirrors:

- [Codeberg](https://codeberg.org/NetSpeaker/NetSpeaker)

## External librarys used:

- ESP32-audioI2S library (https://github.com/schreibfaul1/ESP32-audioI2S as of 2023/12)
- Arduino ESP32-specific librarys (https://github.com/espressif/arduino-esp32/ as of 2023/12)


## License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>

