Your GRiD number is created in the create_save function:
$_core['audio_grid'] = xtSong_create_media_grid($_rt['_profile_id'],$_rt['_item_id']);
jrCore_db_update_item('xtSong',$aid,null,$_core);
You'd add your other custom functions into the create_save in a similar fashion.
You already have the file from this line:
$_fl = jrCore_get_uploaded_media_files('xtSong','audio_file',$_user['user_active_profile_id']);
So you'd use $_fl for any functions that require the file (bpm detection etc) and then save that to the song data in the db.
For anything like additional format conversion, you might do that in the create_save function as well, or possibly in a save_media_file listener. (look at jrVideo_save_media_file_listener for an example of that (it runs the jrCore_get_media_file_metadata function), jrAudio runs the same jrCore_get_media_file_metadata function from the create_save function.
In a nutshell, jrAudio doesn't do any of the things that you wnat it to do, so you need to write the custom functions that do those things, then run those functions in the xtSong_create_save function, have the functions return the info that you need to save to the db, and then add it to the $_rt array when the item is created, or to the $_core array if you need the item id before you run your function (like it does with the GRiD generation where the song id is needed in oreder to create the GRiD).
I don't have the first clue as to how to hand any processing off to a second server.
--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
updated by @ultrajam: 07/02/14 03:55:55PM