Closed lqniunjunlper closed 4 years ago
Makefile:
if ( APPLE OR WIN32 ) option( NIMEDIA_ENABLE_MP3_DECODING "Enable ni-media mp3 decoding" ON ) option( NIMEDIA_ENABLE_MP4_DECODING "Enable ni-media mp4 decoding" ON ) else() option( NIMEDIA_ENABLE_MP3_DECODING "Enable ni-media mp3 decoding" OFF ) option( NIMEDIA_ENABLE_MP4_DECODING "Enable ni-media mp4 decoding" OFF ) endif()
In os_source.h, there is no os_source definition for Linux?
`#pragma once
template
template
``
On Linux, i got an error of Segmentation fault.
ifstream.cpp:65] ifstream:ttt.wav Segmentation fault
std::string file="test.wav"; auto stream = audio::ifstream(file);
`ifstream::ifstream( const std::string& file ) : ifstream() {
if ( is_itunes_url( file ) )
{
auto source = avassetreader_source( file, 0 );
auto info = source.info();
*this = ifstream( make_stream_buffer( std::move( source ) ), std::make_unique<info_type>( std::move( info ) ) );
return;
}
LOG(INFO) << __func__ << ":" << file;
auto container = ifstream_container( file );
if ( !container )
throw std::runtime_error( "Unsupported file extension" );
*this = ifstream( file, *container );
LOG(INFO) << __func__ << " done!";
} `
Mp3 and Mp4 are currently not supported on Linux. On linux only wav, aiff, ogg and flac extensions are supported see https://github.com/NativeInstruments/ni-media/blob/master/audiostream/doc/ifstream.md.
The audio:.ifstream constructor will throw a runtime error when passing an unsupported file path, which is expected behavior. Client code should be using a try / catch block around the constructor and decide what to do in this case.
Thanks@marcrambo Why Linux can not support mp4? Is there any plan for supporting mp4 on Linux? Another question is how can we get meatadata of music, like sample-rate, bit-rate, artist,...
How to generate a new music audio from scratch, in which there is track name, artist, etc,... More importantly it can be played in musicpalyer.
@lqniunjunlper ni-media does not generate audio, but simply streams it. If you're looking for metadata support, you should check out TagLib, which you can use alongside ni-media.
Regarding your other comment about mp4 support, there was an initiative to integrate GStreamer into ni-media, which you can take a look at here: https://github.com/NativeInstruments/ni-media/pull/11
@FalconPDX Thanks
Only wav?