Author Topic: BASS for iOS (iPhone/iPad)  (Read 483665 times)

Ian @ un4seen

  • Administrator
  • Posts: 21024
Re: BASS for iOS (iPhone/iPad)
« Reply #1275 on: 21 Jun '18 - 15:28 »
I'm not a Swift user myself, so unfortunately I can't really help with that, but perhaps this will help?

   https://github.com/Starling-Inc/Bass

pgorasva

  • Posts: 10
Re: BASS for iOS (iPhone/iPad)
« Reply #1276 on: 26 Jun '18 - 10:53 »
Need Help.

How to do type conversion ?

Ian @ un4seen

  • Administrator
  • Posts: 21024
Re: BASS for iOS (iPhone/iPad)
« Reply #1277 on: 26 Jun '18 - 14:24 »
I'm not a Swift user myself, so this is just a guess, but how about something like this?

Code: [Select]
let infoPlay = UnsafeMutablePointer<BASS_CHANNELINFO>.allocate(capacity: 1)
...
infoPlay.deallocate()

pgorasva

  • Posts: 10
Re: BASS for iOS (iPhone/iPad)
« Reply #1278 on: 27 Jun '18 - 06:13 »
Hello Ian,

How can use BASS_ATTRIB_TEMPO_PITCH for different voice conversion ?

Ian @ un4seen

  • Administrator
  • Posts: 21024
Re: BASS for iOS (iPhone/iPad)
« Reply #1279 on: 27 Jun '18 - 17:47 »
The BASS_ATTRIB_TEMPO_PITCH value can be set via BASS_ChannelSetAttribute but only on tempo streams, ie. streams created with BASS_FX_TempoCreate (from the BASS_FX add-on).

pgorasva

  • Posts: 10
Re: BASS for iOS (iPhone/iPad)
« Reply #1280 on: 28 Jun '18 - 07:37 »
The BASS_ATTRIB_TEMPO_PITCH value can be set via BASS_ChannelSetAttribute but only on tempo streams, ie. streams created with BASS_FX_TempoCreate (from the BASS_FX add-on).

Thanks Ian.

BASS_ChannelPlay(playStream!, false)

How to get new file path.? i need to send file path to server and play on different platform.
« Last Edit: 28 Jun '18 - 09:27 by pgorasva »

Ian @ un4seen

  • Administrator
  • Posts: 21024
Re: BASS for iOS (iPhone/iPad)
« Reply #1281 on: 28 Jun '18 - 14:50 »
Do you want to get the filename of an existing stream? If so, that is available from BASS_ChannelGetInfo (see the BASS_CHANNELINFO "filename" field).

pgorasva

  • Posts: 10
Re: BASS for iOS (iPhone/iPad)
« Reply #1282 on: 29 Jun '18 - 08:30 »
Do you want to get the filename of an existing stream? If so, that is available from BASS_ChannelGetInfo (see the BASS_CHANNELINFO "filename" field).


After this i need to create new file which has this audio effect.

is there any idea to how to do this. ?

Thanks!
« Last Edit: 29 Jun '18 - 12:40 by pgorasva »

Ian @ un4seen

  • Administrator
  • Posts: 21024
Re: BASS for iOS (iPhone/iPad)
« Reply #1283 on: 29 Jun '18 - 17:37 »
You can use the BASSenc add-on to write a new file. For example, to write a WAV file, you can do this:

Code: [Select]
encoder = BASS_Encode_Start(mChanPlay, filename, BASS_ENCODE_PCM, NULL, NULL);

The WAV file will then be written while the original file is decoded/played. Use BASS_Encode_Stop (on the "encoder" handle) afterwards to close the WAV file.

On iOS, you can use BASS_Encode_StartCAFile instead of BASS_Encode_Start for AAC for ALAC encoding. There are also add-ons available for FLAC, Ogg Vorbis, Opus encoding.

pgorasva

  • Posts: 10
Re: BASS for iOS (iPhone/iPad)
« Reply #1284 on: 2 Jul '18 - 07:40 »
You can use the BASSenc add-on to write a new file. For example, to write a WAV file, you can do this:

Code: [Select]
encoder = BASS_Encode_Start(mChanPlay, filename, BASS_ENCODE_PCM, NULL, NULL);

The WAV file will then be written while the original file is decoded/played. Use BASS_Encode_Stop (on the "encoder" handle) afterwards to close the WAV file.

On iOS, you can use BASS_Encode_StartCAFile instead of BASS_Encode_Start for AAC for ALAC encoding. There are also add-ons available for FLAC, Ogg Vorbis, Opus encoding.

Thanks Ian.

i am using this https://github.com/Starling-Inc/Bass.

if i remove this and add manually bass.h and bass_fx.h and bassenc.h than i get this types of error (Use of unresolved identifier BASS_FX_TempoGetSource.) 

now what can do for encoding file.?

or
using GitHub link how to load BASSENC plugin ?
« Last Edit: 2 Jul '18 - 11:04 by pgorasva »

Ian @ un4seen

  • Administrator
  • Posts: 21024
Re: BASS for iOS (iPhone/iPad)
« Reply #1285 on: 2 Jul '18 - 13:29 »
i am using this https://github.com/Starling-Inc/Bass.

It looks like the way they've done it is to append the add-on headers to the BASS.H file, so you could take the BASSENC.H file from the BASSenc package on the BASS page and copy'n'paste it to the end of that BASS.H file. Or perhaps add an #include "bassenc.h" line to the BassPluginLoad.c file instead.

pgorasva

  • Posts: 10
Re: BASS for iOS (iPhone/iPad)
« Reply #1286 on: 3 Jul '18 - 07:00 »
encoder = BASS_Encode_Start(mChanPlay, filename, BASS_ENCODE_PCM, NULL, NULL);

can you describe more .?
« Last Edit: 3 Jul '18 - 10:09 by pgorasva »

Ian @ un4seen

  • Administrator
  • Posts: 21024
Re: BASS for iOS (iPhone/iPad)
« Reply #1287 on: 3 Jul '18 - 15:09 »
More information can be found in the documentation:

   www.un4seen.com/doc/#bassenc/BASS_Encode_Start.html

pgorasva

  • Posts: 10
Re: BASS for iOS (iPhone/iPad)
« Reply #1288 on: 4 Jul '18 - 12:01 »
More information can be found in the documentation:

   www.un4seen.com/doc/#bassenc/BASS_Encode_Start.html

it's work.

Thanks Ian.

pgorasva

  • Posts: 10
Re: BASS for iOS (iPhone/iPad)
« Reply #1289 on: 4 Jul '18 - 13:44 »
Can we encode to wave file without BASS_ChannelPlay .?

« Last Edit: 4 Jul '18 - 15:03 by pgorasva »

Ian @ un4seen

  • Administrator
  • Posts: 21024
Re: BASS for iOS (iPhone/iPad)
« Reply #1290 on: 4 Jul '18 - 17:39 »
Yes. For that you need to create a "decoding channel" by using the BASS_STREAM_DECODE flag in your BASS_StreamCreateFile call, and then repeatedly call BASS_ChannelGetData on it (eg. in a worker thread or timer) until you reach the end.

pgorasva

  • Posts: 10
Re: BASS for iOS (iPhone/iPad)
« Reply #1291 on: 5 Jul '18 - 07:03 »
Thanks Ian.

if i remove this line BASS_ChannelPlay(mChanPlay!, false) than my new file is empty.

how to write in file without BASS_ChannelPlay(mChanPlay!, false)  .?

Can you help us.? share some example to how to do this.

 

Ian @ un4seen

  • Administrator
  • Posts: 21024
Re: BASS for iOS (iPhone/iPad)
« Reply #1292 on: 5 Jul '18 - 15:49 »
That sounds like you probably didn't add the BASS_STREAM_DECODE flag to your BASS_StreamCreateFile call. You could do something like this:

Code: [Select]
DWORD decoder = BASS_StreamCreateFile(false, filename, 0, 0, BASS_STREAM_DECODE); // create a decoder for the file
DWORD encoder = BASS_Encode_Start(decoder, outfilename, BASS_ENCODE_PCM | BASS_ENCODE_AUTOFREE, 0, 0); // set a WAV writer on it

// processing loop
while (1) {
BYTE buf[20000]; // processing buffer
int r = BASS_ChannelGetData(decoder, buf, sizeof(buf)); // process the decoder (feeds the encoder)
if (r < 0) break; // reached the end
}

BASS_StreamFree(decoder); // free the decoder (and encoder due to AUTOFREE)

pgorasva

  • Posts: 10
Re: BASS for iOS (iPhone/iPad)
« Reply #1293 on: 6 Jul '18 - 05:52 »
That sounds like you probably didn't add the BASS_STREAM_DECODE flag to your BASS_StreamCreateFile call. You could do something like this:

Code: [Select]
DWORD decoder = BASS_StreamCreateFile(false, filename, 0, 0, BASS_STREAM_DECODE); // create a decoder for the file
DWORD encoder = BASS_Encode_Start(decoder, outfilename, BASS_ENCODE_PCM | BASS_ENCODE_AUTOFREE, 0, 0); // set a WAV writer on it

// processing loop
while (1) {
BYTE buf[20000]; // processing buffer
int r = BASS_ChannelGetData(decoder, buf, sizeof(buf)); // process the decoder (feeds the encoder)
if (r < 0) break; // reached the end
}

BASS_StreamFree(decoder); // free the decoder (and encoder due to AUTOFREE)

it's work.

Thanks Ian.

Ian @ un4seen

  • Administrator
  • Posts: 21024
Re: BASS for iOS (iPhone/iPad)
« Reply #1294 on: 17 Jul '18 - 14:14 »
The iOS version of the new BASSenc, BASSenc_FLAC and BASSenc_MP3 releases are up now in the 1st post.

vandenbrakel

  • Posts: 7
Re: BASS for iOS (iPhone/iPad)
« Reply #1295 on: 17 Jul '18 - 15:55 »
I'm trying to figure out which (compressed) audio format would use the least cpu with Bass on iOS. I've found out that m4a works better than ogg.

Any wise words on this?

Thanks.

Ian @ un4seen

  • Administrator
  • Posts: 21024
Re: BASS for iOS (iPhone/iPad)
« Reply #1296 on: 17 Jul '18 - 17:16 »
Yes, M4A/AAC files are indeed likely to use less CPU because they can use hardware accelerated decoding on iOS devices. That applies to MP3 too when using the "mp3-free" BASS version.

vandenbrakel

  • Posts: 7
Re: BASS for iOS (iPhone/iPad)
« Reply #1297 on: 17 Jul '18 - 18:10 »
Thanks! Very usefull.

Yes, M4A/AAC files are indeed likely to use less CPU because they can use hardware accelerated decoding on iOS devices. That applies to MP3 too when using the "mp3-free" BASS version.