0

I have successfully decoded a local file using Superpowered

SuperpoweredDecoder *decoder = new SuperpoweredDecoder();
const char *openError = decoder->open("/Users/john/Desktop/myFile.mp3", false, 0, 0);

    if (openError) {
        NSLog(@"open error: %s", openError);
        delete decoder;
        return 0;
    };

Now I'd like to do the same with a remote URL

eg. by replacing the decoder->open call with...

 const char *openError = decoder->open("https://example.com/api/mobile/courses/redirect/Z3VpZpZGVvcy9qbTMwYWJnLTAwMS5tcDM%3D?courseid=678");

(I've changed the URL a bit here as it's not a URL I should be releasing, however, I have confirmed that the URL was good by pasting it into Chrome address bar - Chrome plays the mp3)

the result: open error: @

The Superpowered documentation describes path as: Full file system path or progressive download path (http or https). so I thought this might be possible.

Do I need to be setting customHTTPHeaders - if so, any guidance on how to use this field?

Jon Cook
  • 127
  • 1
  • 11

1 Answers1

0

This is undocumented, beta behaviour yet. The @ means that the open() method needs more time to open the file (due network traffic). Just iterate over open() until you receive something else than '@'. Don't forget to sleep() between the iterations to allow the network stack doing its job.

Gabor Szanto
  • 1,329
  • 8
  • 12
  • Thanks. After first 1 second sleep (and before I had re-called open(), it crashed). Just before the 'BAD ACCESS' the dump included: ...... '<+1026> at SuperpoweredHTTP.cpp 0x1081cf0d4 <+200>: leaq 0x24bd5(%rip), %r12 ; "URL is NULL." 0x1081cf0db <+207>: jmp 0x1081cf413 ; <+1031> at SuperpoweredHTTP.cpp 0x1081cf0e0 <+212>: leaq 0x24c43(%rip), %r12 ; "Filename is NULL." ...... Which looks like the URL or filename was not supplied in the original call - but the URL was! – Jon Cook Sep 11 '17 at 20:00
  • Hi Gabor - trying again.. same issue.. here's the relevant part of the dump, just before message: Progressive Download (38): EXC_BAD_ACCESS..........0x10d42ac77 <+219>: jmp 0x10d42afa3 ; <+1031> at SuperpoweredHTTP.cpp 0x10d42ac7c <+224>: movq %rbx, -0xc0(%rbp) 0x10d42ac83 <+231>: movl %r14d, -0xc8(%rbp) 0x10d42ac8a <+238>: movq %r13, %rdi 0x10d42ac8d <+241>: callq 0x10d42d3d6 ; symbol stub for: strlen 0x10d42ac92 <+246>: shlq $0x20, %rax <----- FAILS HERE – Jon Cook Sep 22 '17 at 06:45
  • Use SuperpoweredAdvancedAudioPlayer::setTempFolder. – Gabor Szanto Sep 23 '17 at 16:36