Skip to content

Commit

Permalink
Update types and documentation regarding events
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
  • Loading branch information
pguyot committed May 11, 2024
1 parent edcfc3b commit 91153aa
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
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).

0 comments on commit 91153aa

Please sign in to comment.