You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/application/native/guides/multimedia/media-playback.md
-149Lines changed: 0 additions & 149 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,14 +21,6 @@ The main media playback features are:
21
21
22
22
Enables you to set specific URLs for [streaming media playback](#stream).
23
23
24
-
- Using the WAV player
25
-
26
-
Enables you to play audio in the [WAVE format](#wav).
27
-
28
-
- Using the tone player
29
-
30
-
Enables you to play [tones](#tone).
31
-
32
24
Before you start, [set up the player](#prepare).
33
25
34
26
<aname="audio"></a>
@@ -153,49 +145,6 @@ The player supports the streaming protocol features:
153
145
- Real Time Streaming Protocol (RTSP)
154
146
- RTSP Streaming
155
147
156
-
<aname="wav"></a>
157
-
## WAV Player
158
-
159
-
The [WAV Player API](../../api/common/latest/group__CAPI__MEDIA__WAV__PLAYER__MODULE.html) provides controlling functions for using audio resources (media files stored on the device). Use the WAV Player API to enable your application to play audio and control playback. You can use the WAV and OGG audio formats.
160
-
161
-
Tizen enables your application to play WAVE format audio in 1 of 2 ways:
162
-
163
-
- Through the multimedia application control
164
-
165
-
When using the [multimedia application control](../app-management/common-appcontrols.md#multimedia), the device standard media player application is launched to play audio.
166
-
167
-
- With the WAV player functions
168
-
169
-
When [using the WAV player functions](#start_wav), your application plays audio using its own user interface.
170
-
171
-
Most operations of the WAV Player API work in a synchronous mode. The WAV Player API requires a callback to notify the application of the operational status of the player. The callback must be implemented and passed to stop the WAV playback.
172
-
173
-
Multiple instances of the WAV player can be used to play several audio data streams concurrently. This means that your application can play multiple uncompressed audio files, such as WAV, at the same time.
174
-
175
-
The following figure illustrates the general WAV player state changes.
176
-
177
-
**Figure: WAV player state changes**
178
-
179
-

180
-
181
-
<aname="tone"></a>
182
-
## Tone Player
183
-
184
-
Tizen enables your application to play a tone or a list of tones using the [Tone Player API](../../api/common/latest/group__CAPI__MEDIA__TONE__PLAYER__MODULE.html).
185
-
186
-
You can generate tones in 2 ways:
187
-
188
-
- Specify the frequency values. You can specify either 1 or 2 frequencies.
189
-
- Use a DTMF (Dual Tone Multi Frequency) preset frequency value of the [`tone_type_e`](../../api/common/latest/group__CAPI__MEDIA__TONE__PLAYER__MODULE.html#gaf12912b2c8f9ffe720518ce797506574) enumerator.
190
-
191
-
You can [start and stop playing a tone](#play_tone), and [play a tone for a specified duration](#duration).
192
-
193
-
The following figures illustrate the general tone player state changes.
194
-
195
-
**Figure: Tone player states**
196
-
197
-

198
-
199
148
## Prerequisites
200
149
201
150
To enable your application to use the playback functionality:
@@ -276,22 +225,6 @@ To enable your application to use the playback functionality:
276
225
}
277
226
```
278
227
279
-
3. To start using the tone player, declare a player ID variable for identifying the tone player:
280
-
281
-
```
282
-
int tone_player_id;
283
-
```
284
-
285
-
4. To use the functions and data types of the [WAV Player API](../../api/common/latest/group__CAPI__MEDIA__WAV__PLAYER__MODULE.html), include the `<wav_player.h>` header file in your application:
286
-
287
-
```
288
-
#include <wav_player.h>
289
-
#include <stdio.h>
290
-
#include <sound_manager.h>
291
-
```
292
-
293
-
In this guide, you also need the `<stdio.h>` and `<sound_manager.h>` header files to use standard file input and output functions and the [Sound Manager API](../../api/common/latest/group__CAPI__MEDIA__SOUND__MANAGER__MODULE.html) functions.
294
-
295
228
<aname="prepare"></a>
296
229
## Preparing the Player
297
230
@@ -853,88 +786,6 @@ To insert subtitles to a video file:
853
786
>
854
787
> You can set the subtitle path when the player state is `PLAYER_STATE_IDLE`, `PLAYER_STATE_READY`, `PLAYER_STATE_PLAYING`, or `PLAYER_STATE_PAUSED`.
855
788
856
-
<a name="start_wav"></a>
857
-
## Starting and Stopping the WAV Player
858
-
859
-
To start and stop the WAV player:
860
-
861
-
1. Start playback using the `wav_player_start_new()` function.
862
-
863
-
The second parameter should be sound information handle which can created by `sound_manager_create_stream_information()`.
864
-
865
-
The third parameter defines a callback that is invoked when the player finishes playback. Implement the callback and handle any post-playback actions in it.
866
-
867
-
The final parameter returns the WAV player ID, which you need to stop the player.
ret = wav_player_start_new(wav_path, stream_info, _playback_completed_cb, (void*)wav_path, &wav_player_id);
888
-
}
889
-
```
890
-
891
-
To set the path of your WAV file, you may need to retrieve the default path for audio files. For more information, see the [Data Storages](../data/data-storages.md) guide.
892
-
893
-
2. To stop the WAV player, use the `wav_player_stop()` function with the ID of the WAV player:
894
-
895
-
```
896
-
void
897
-
my_stop()
898
-
{
899
-
wav_player_error_e ret;
900
-
ret = wav_player_stop(wav_player_id);
901
-
}
902
-
```
903
-
904
-
<a name="play_tone"></a>
905
-
## Playing a Tone
906
-
907
-
To start and stop playing a tone:
908
-
909
-
1. Start playback using the `tone_player_start_new()` function.
910
-
911
-
The first parameter should be the [`tone_type_e`](../../api/common/latest/group__CAPI__MEDIA__TONE__PLAYER__MODULE.html#gaf12912b2c8f9ffe720518ce797506574) enumerators which can define the available values for the tone type.
912
-
913
-
The second parameter should be sound information handle which can created by `sound_manager_create_stream_information()`.
The player ID is assigned and returned if the function succeeds. The ID of the tone player that starts first is 0, the ID of the second one is 1, and so on. If you set the player ID parameter to `NULL`, the ID is not returned.
920
-
921
-
2. To stop playback, use the `tone_player_stop()` function with the ID of the player you want to stop:
922
-
923
-
```
924
-
tone_player_stop(tone_player_id);
925
-
```
926
-
927
-
<a name="duration"></a>
928
-
## Playing a Tone for a Specified Duration
929
-
930
-
To play a tone for a specified duration, use the `tone_player_start_new()` function with the duration (third parameter) set to the number of milliseconds you want playback to last:
When you set the duration to a specified time, playback stops automatically after that time. You can also stop playback manually using the `tone_player_stop()` function.
Copy file name to clipboardExpand all lines: docs/application/native/guides/multimedia/overview.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,10 @@ You can use the following multimedia features in your native applications:
29
29
30
30
You can manage the playback of different media file types. You can play audio and video files, and tones. You can also manage the state of the media player.
31
31
32
+
-[WAV and Tone Player](wav-tone-player.md)
33
+
34
+
You can manage the playback of different media file types. You can play audio and video files, and tones. You can also manage the state of the media player.
35
+
32
36
-[Media Recording](media-recording.md)
33
37
34
38
You can manage the recording of different media file types. You can record audio data to a file and generate compressed video files using video data from a camera and audio data from an audio input device.
You can simply play WAV format files or TONE sound in your application.
5
+
6
+
- Using the WAV player
7
+
8
+
Enables you to play audio in the [WAVE format](#wav).
9
+
10
+
- Using the tone player
11
+
12
+
Enables you to play [tones](#tone).
13
+
14
+
<aname="wav"></a>
15
+
## WAV Player
16
+
17
+
The [WAV Player API](../../api/common/latest/group__CAPI__MEDIA__WAV__PLAYER__MODULE.html) provides controlling functions for using audio resources (media files stored on the device). Use the WAV Player API to enable your application to play audio and control playback. You can use the WAV and OGG audio formats.
18
+
19
+
Tizen enables your application to play WAVE format audio in 1 of 2 ways:
20
+
21
+
- Through the multimedia application control
22
+
23
+
When using the [multimedia application control](../app-management/common-appcontrols.md#multimedia), the device standard media player application is launched to play audio.
24
+
25
+
- With the WAV player functions
26
+
27
+
When [using the WAV player functions](#start_wav), your application plays audio using its own user interface.
28
+
29
+
Most operations of the WAV Player API work in a synchronous mode. The WAV Player API requires a callback to notify the application of the operational status of the player. The callback must be implemented and passed to stop the WAV playback.
30
+
31
+
Multiple instances of the WAV player can be used to play several audio data streams concurrently. This means that your application can play multiple uncompressed audio files, such as WAV, at the same time.
32
+
33
+
The following figure illustrates the general WAV player state changes.
34
+
35
+
**Figure: WAV player state changes**
36
+
37
+

38
+
39
+
<aname="tone"></a>
40
+
## Tone Player
41
+
42
+
Tizen enables your application to play a tone or a list of tones using the [Tone Player API](../../api/common/latest/group__CAPI__MEDIA__TONE__PLAYER__MODULE.html).
43
+
44
+
You can generate tones in 2 ways:
45
+
46
+
- Specify the frequency values. You can specify either 1 or 2 frequencies.
47
+
- Use a DTMF (Dual Tone Multi Frequency) preset frequency value of the [`tone_type_e`](../../api/common/latest/group__CAPI__MEDIA__TONE__PLAYER__MODULE.html#gaf12912b2c8f9ffe720518ce797506574) enumerator.
48
+
49
+
You can [start and stop playing a tone](#play_tone), and [play a tone for a specified duration](#duration).
50
+
51
+
The following figures illustrate the general tone player state changes.
52
+
53
+
**Figure: Tone player states**
54
+
55
+

56
+
57
+
## Prerequisites
58
+
59
+
To enable your application to use the playback functionality:
60
+
61
+
1. To start using the tone player, declare a player ID variable for identifying the tone player:
62
+
63
+
```
64
+
int tone_player_id;
65
+
```
66
+
67
+
2. To use the functions and data types of the [WAV Player API](../../api/common/latest/group__CAPI__MEDIA__WAV__PLAYER__MODULE.html), include the `<wav_player.h>` header file in your application:
68
+
69
+
```
70
+
#include <wav_player.h>
71
+
#include <stdio.h>
72
+
#include <sound_manager.h>
73
+
```
74
+
75
+
In this guide, you also need the `<stdio.h>` and `<sound_manager.h>` header files to use standard file input and output functions and the [Sound Manager API](../../api/common/latest/group__CAPI__MEDIA__SOUND__MANAGER__MODULE.html) functions.
76
+
77
+
<aname="start_wav"></a>
78
+
## Starting and Stopping the WAV Player
79
+
80
+
To start and stop the WAV player:
81
+
82
+
1. Start playback using the `wav_player_start_new()` function.
83
+
84
+
The second parameter should be sound information handle which can created by `sound_manager_create_stream_information()`.
85
+
86
+
The third parameter defines a callback that is invoked when the player finishes playback. Implement the callback and handle any post-playback actions in it.
87
+
88
+
The final parameter returns the WAV player ID, which you need to stop the player.
ret = wav_player_start_new(wav_path, stream_info, _playback_completed_cb, (void*)wav_path, &wav_player_id);
109
+
}
110
+
```
111
+
112
+
To set the path of your WAV file, you may need to retrieve the default path for audio files. For more information, see the [Data Storages](../data/data-storages.md) guide.
113
+
114
+
2. To stop the WAV player, use the `wav_player_stop()` function with the ID of the WAV player:
115
+
116
+
```
117
+
void
118
+
my_stop()
119
+
{
120
+
wav_player_error_e ret;
121
+
ret = wav_player_stop(wav_player_id);
122
+
}
123
+
```
124
+
125
+
<aname="play_tone"></a>
126
+
## Playing a Tone
127
+
128
+
To start and stop playing a tone:
129
+
130
+
1. Start playback using the `tone_player_start_new()` function.
131
+
132
+
The first parameter should be the [`tone_type_e`](../../api/common/latest/group__CAPI__MEDIA__TONE__PLAYER__MODULE.html#gaf12912b2c8f9ffe720518ce797506574) enumerators which can define the available values for the tone type.
133
+
134
+
The second parameter should be sound information handle which can created by `sound_manager_create_stream_information()`.
The player ID is assigned and returned if the function succeeds. The ID of the tone player that starts first is 0, the ID of the second one is 1, and so on. If you set the player ID parameter to `NULL`, the ID is not returned.
141
+
142
+
2. To stop playback, use the `tone_player_stop()` function with the ID of the player you want to stop:
143
+
144
+
```
145
+
tone_player_stop(tone_player_id);
146
+
```
147
+
148
+
<aname="duration"></a>
149
+
## Playing a Tone for a Specified Duration
150
+
151
+
To play a tone for a specified duration, use the `tone_player_start_new()` function with the duration (third parameter) set to the number of milliseconds you want playback to last:
When you set the duration to a specified time, playback stops automatically after that time. You can also stop playback manually using the `tone_player_stop()` function.
0 commit comments