@@ -40,7 +40,7 @@ public function it_throws_an_exception_when_no_format_has_been_added()
40
40
}
41
41
42
42
/** @test */
43
- public function it_can_export_a_single_media_file_into_a_hls_export ()
43
+ public function it_can_export_a_single_video_file_into_a_hls_export ()
44
44
{
45
45
$ this ->fakeLocalVideoFile ();
46
46
@@ -86,6 +86,41 @@ public function it_can_export_a_single_media_file_into_a_hls_export()
86
86
]);
87
87
}
88
88
89
+ /** @test */
90
+ public function it_can_export_a_single_audio_file_into_a_hls_export ()
91
+ {
92
+ $ this ->fakeLocalAudioFile ();
93
+
94
+ $ lowBitrate = $ this ->x264 ()->setAudioKiloBitrate (250 );
95
+ $ midBitrate = $ this ->x264 ()->setAudioKiloBitrate (1000 );
96
+ $ highBitrate = $ this ->x264 ()->setAudioKiloBitrate (4000 );
97
+
98
+ (new MediaOpener )
99
+ ->open ('guitar.m4a ' )
100
+ ->exportForHLS ()
101
+ ->addFormat ($ lowBitrate )
102
+ ->addFormat ($ midBitrate )
103
+ ->addFormat ($ highBitrate )
104
+ ->toDisk ('local ' )
105
+ ->save ('adaptive.m3u8 ' );
106
+
107
+ $ this ->assertTrue (Storage::disk ('local ' )->has ('adaptive.m3u8 ' ));
108
+ $ this ->assertTrue (Storage::disk ('local ' )->has ('adaptive_0_250.m3u8 ' ));
109
+ $ this ->assertTrue (Storage::disk ('local ' )->has ('adaptive_1_1000.m3u8 ' ));
110
+ $ this ->assertTrue (Storage::disk ('local ' )->has ('adaptive_2_4000.m3u8 ' ));
111
+
112
+ $ this ->assertPlaylistPattern (Storage::disk ('local ' )->get ('adaptive.m3u8 ' ), [
113
+ '#EXTM3U ' ,
114
+ '#EXT-X-STREAM-INF:BANDWIDTH=275000,CODECS="mp4a.40.34" ' ,
115
+ 'adaptive_0_250.m3u8 ' ,
116
+ '#EXT-X-STREAM-INF:BANDWIDTH=1100000,CODECS="mp4a.40.34" ' ,
117
+ 'adaptive_1_1000.m3u8 ' ,
118
+ '#EXT-X-STREAM-INF:BANDWIDTH=4400000,CODECS="mp4a.40.34" ' ,
119
+ 'adaptive_2_4000.m3u8 ' ,
120
+ '#EXT-X-ENDLIST ' ,
121
+ ]);
122
+ }
123
+
89
124
/** @test */
90
125
public function it_can_set_additional_parameters_on_the_format ()
91
126
{
0 commit comments