Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update types and documentation regarding events #8

Merged
merged 1 commit into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion nifs/atomvm_esp_adf_aac_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"

#include <aac_decoder.h>
#include <esp_attr.h>
#include <esp_log.h>
#include <esp_system.h>

#include <aac_decoder.h>

#pragma GCC diagnostic pop

#include <context.h>
Expand Down
2 changes: 1 addition & 1 deletion src/esp_adf_aac_decoder.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
%% @doc Create a handle to an AAC decoder audio element.
%% @param Cfg configuration
%% @return an audio element resource
-spec init([]) -> esp_adf_audio_element:audio_element().
-spec init([esp_adf_audio_element:audio_element_opt()]) -> esp_adf_audio_element:audio_element().
init(_Cfg) ->
erlang:nif_error(undefined).
2 changes: 1 addition & 1 deletion src/esp_adf_audio_element.erl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
| codec_fmt
| {position, [audio_element_position_prop()]}.

%% @doc Set read callback to read a given binary
%% @doc Set read callback to read a given binary.
%% If binary is reference counted, it is not copied.
%% @param AudioElement element to set read callback to
%% @param Binary binary to read
Expand Down
4 changes: 2 additions & 2 deletions src/esp_adf_audio_pipeline.erl
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ stop(_AudioPipeline) ->
erlang:nif_error(undefined).

%% @doc Wait for the pipeline to stop. This function is a dirty nif, i.e. it
%% blocks the scheduler until the pipeline is stopped. So users should use
%% events (yet to be ported) to only call it when the pipeline is stopped.
%% blocks the scheduler until the pipeline is stopped. So users should only
%% call it when the pipeline is stopped.
%% @param AudioPipeline pipeline to wait to be stopped
%% @return ok
-spec wait_for_stop(audio_pipeline()) -> ok.
Expand Down
3 changes: 2 additions & 1 deletion src/esp_adf_i2s_output.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
-export([init/1]).

-type i2s_output_option() ::
{rate, pos_integer()}
esp_adf_audio_element:audio_element_opt()
| {rate, pos_integer()}
| {bits, 8 | 16 | 24 | 32}
| {channels, 1 | 2}
| {gpio_mclk, -1 | non_neg_integer()}
Expand Down
2 changes: 1 addition & 1 deletion src/esp_adf_mp3_decoder.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
%% @doc Create a handle to an MP3 decoder audio element.
%% @param Cfg configuration
%% @return an audio element resource
-spec init([]) -> esp_adf_audio_element:audio_element().
-spec init([esp_adf_audio_element:audio_element_opt()]) -> esp_adf_audio_element:audio_element().
init(_Cfg) ->
erlang:nif_error(undefined).