Mac, OBS and Streaming Audio Right

OBS has for some time been working on it’s new version of OBS which is called OBS studio, and is cross platform. Finally we are free from having to faff about with WireCast, we can now just plug and play and Stream away. BUT WAIT it’s not just that simple!

If you ever tried Minecraft’s in game streaming it will at least (force) prompt you to download additional required software to get you going.

This software (whilst not needed, (well it’s not but you are a idiot if you don’t setup your audio properly)) will get your Audio going properly on OBS streaming when you are not using additional Hardware.

This piece of software is called Soundflower, and is an example of Virtual Audio Cabling, which basically creates a software based Sound Card inside your computer in order to route audio more usefully!

Installing

So first things first, grab yourself a copy of OBS Studio, you can find the latest version on GitHub here. Download and install!

Next we’ll grab a copy of SoundFlower which is on their site here or GitHub here.

SoundFlower will need you to restart your Computer.

Getting Setup

Lets fire up OBS Studio:

OBS 0.9.1

I’ve got a few extra scenes setup, but this is the layout you’ll be presented with!

We are going to add a source, (first make a scene of course) in this case a “Audio Output Capture”

Audio Selection

And then, to keep things simple, just select the SoundFlower 2 Channel. We don’t need to do anything wacky.

Input Select

Finally we need to change the Sound Settings under System Preferences. So open System Preferences and Sound. And select Soundflower (2ch) as the Output device.

System Prefs Sound

Now suddenly everything will go quiet as all your audio is being sent to OBS/Soundflower: (it’s good to check that OBS is actually detecting at this point)

Audio Monitoring

We need to route the Audio from your computer via Soundflower back to Speakers/headphones. For this open SoundflowerBed:

SoundFlowerBed

It’s under Applications/Soundflower, this fires up a Menu Item in the Top Dock

Top Menu

Just click that, and send the Soundflower (2ch) back to “Built in Output/headphones” And now both you and OBS can hear everything.

Soundflower Routing

Your computer’s audio is now sent to this device and captured by OBS.

(You can tell as my mic here is picking up my speakers):

Preview

And there we go πŸ™‚

BONUS

(Billy May’s Voice) BUT WAIT THERES MORE!

Xbox 360 Controller on Mac under Yosemite?

Unofficial Release 0.14 works fine and it’s on GitHub here

BONUS BONUS

Now what do you do if you get Beachball of Death when trying to use the SoundflowerBed Icon from the menu?

First open Terminal (sorry).
Then type:

ps aux | grep Soundflowerbed.app

Then you’ll see something like this:

SoundflowerBed Hunt

Then type:

kill 9331

Where 9331 is replaced with the number here:

SoundflowerBed Kill

It is VERY important you kill the right thing. As otherwise you might break something and have to restart the whole computer.

Once you have kill’ed SoundflowerBed, just reopen and all should be good.

Further Reading: Some Tips from Tuts+

Magento – The missing view type!

Magento has four options when it comes to display products on your e-commerce website:

  1. Not Visible Individually
  2. Catalog
  3. Search
  4. Catalog, Search

Now, normally that about covers most use cases. But if you have configurable products it is somewhat more common place to set the children to Not Visible Individually.

This is great and all, but what if you are using Google Shopping real-time attribute/schema scraping which requires the Child to be visible individually to read those tags (and can be handy for direct to a page when SKU searching on the front end), and you don’t want the children to show in either your category or search grid pages?

This is where an additional catalog visibility type comes in useful, and it is actually very straight forward to achieve!

First setup a basic Magento module/plugin, which I won’t bore you with the complete details of, but we are binding to a model of the Mage Catalog Module under a rewrite!

Set up your

local/Company/Catalog/etc/config.xml

as follows:

<?xml version="1.0"?>
<config>
    <modules>
        <Company_Catalog>
            <version>0.0.1</version>
        </Company_Catalog>
    </modules>
    <global>
        <models>
            <catalog>
                <rewrite>
                    <product_visibility>Company_Catalog_Model_Product_Visibility</product_visibility>
               </rewrite>
            </catalog>
        </models>
    </global>
</config>

Fairly straight forward here, setup a basic module and override Mage/Catalog/Product/Visibility.

Next setup the Model

local/Company/Catalog/Model/Product/Visibility.php
class Company_Catalog_Model_Product_Visibility extends Mage_Catalog_Model_Product_Visibility {
    const VISIBILITY_PAGE = 5;
    
    public function getVisibleInSiteIds()
    {
        return array(self::VISIBILITY_IN_SEARCH, self::VISIBILITY_IN_CATALOG, self::VISIBILITY_BOTH, self::VISIBILITY_PAGE);
    }
    
    static public function getOptionArray()
    {
        return array(
            self::VISIBILITY_NOT_VISIBLE=> Mage::helper('catalog')->__('Not Visible Individually'),
            self::VISIBILITY_IN_CATALOG => Mage::helper('catalog')->__('Catalog'),
            self::VISIBILITY_IN_SEARCH  => Mage::helper('catalog')->__('Search'),
            self::VISIBILITY_BOTH       => Mage::helper('catalog')->__('Catalog, Search'),
            self::VISIBILITY_PAGE       => Mage::helper('catalog')->__('Own Page Only')
        );
    }
    
    /**
     * Retrieve all options
     *
     * @return array
     */
    static public function getAllOption()
    {
        $options = self::getOptionArray();
        array_unshift($options, array('value'=>'', 'label'=>''));
        return $options;
    }
    
    /**
     * Retireve all options
     *
     * @return array
     */
    static public function getAllOptions()
    {
        $res = array();
        $res[] = array('value'=>'', 'label'=> Mage::helper('catalog')->__('-- Please Select --'));
        foreach (self::getOptionArray() as $index => $value) {
            $res[] = array(
               'value' => $index,
               'label' => $value
            );
        }
        return $res;
    }
    
    /**
     * Retrieve option text
     *
     * @param int $optionId
     * @return string
     */
    static public function getOptionText($optionId)
    {
        $options = self::getOptionArray();
        return isset($options[$optionId]) ? $options[$optionId] : null;
    }
}

First of all we add a new Constant, logically named

VISIBILITY_PAGE

and we give it the next free “id” of 5. (Check core/Mage/Catalog/Model/Product/Visibility.php for the base list).

Next the important function

getVisibleInSiteIds

tells Magento which Products to allow to be shown individually, so we just add our constant to the array here.

All the other functions deal with rendering the new Visibility type in the admin interface for editing products (as otherwise the parent functions are used and they can’t “see” the new visibility type).

As per usual when you add/edit a new module make sure to clear the cache accordingly!

That is it all done, short and sweet!

Fun with WP.me and Twitter Cards

I was trying to figure out why my Twitter Cards weren’t working when I was tinkering with someone else’s WordPress install.

Turns out at some point Twitter decided to follow the WP.me redirect and grab the page behind is differently.

So, now you need to whitelist your domain rather than WP.me.

To do that pop along to The Card Validator with one of your none WP.me Blog Post URL’s in hand and pop it in the validator box.

twitter_card_validation

Click request approval, fill in the little form and wack submit! It might throw an error but retest your page and all should be good!

pending

Give it a few minutes:

waiting

And Finally:

finally

A working Tweet!

Updated like so:

Barry_Carlyon_on_Twitter___Fun_with_WP_me_and_Twitter_Cards_http___t_co_WYcrgwtMgG_

Writing PHP Code to Standard

So with the release of AWS SDK Version 2, I’ve been inspired a little to write better PHP Code, at least in stuff I have on my GitHub. The new SDK is written to match the PHP Framework Interop Group PSR-0, PSR-1 and PSR-2, as well as Composer/Packagist Support.

I been working a on project to make starting a new project easier, (create a repo, setup the deployments, Apache VHost etc). Primarily working off of the ATech Media Suite of products.

Starting from a base of peterjaap’s Codebase PHP Wrapper, where I was just adding missing API endpoints to the class, at which point the new AWS SDK was released and inspiration of a sort struck.

I started a new project from scratch, to implement all the API’s that Atech runs, it’s very much in progress, I’ve currently got full support for DeployHQ and PointHQ end points, (as well as having gotten a few obvious missing end points added to the API).

I’m clunking my way thru the CodeBase API, it’s taking some time as its got a truck load more end points, that DeployHQ and PointHQ put together. It has Projects, which have repos, which have tickets, just to scratch the surface.

At the moment it’s largely functional, it’s just missing some extras, the Time Tracking, File Uploads, and so on.
It’s very much a learning experience in an attempt to follow the coding standards as well as laying the code out properly.

At the moment the CodeBase class itself is pretty large, and I’m pondering about splitting it out to sub classes. Classes to represent Projects and Repos and Tickets and so on, but its the first thing I’ve tried to build in such a way, so much consideration is needed, to hopefully get it right. I keep looking at other Project like the AWS SDK and GoCardless’ PHP Class.

The only thing thats really missing, is Unit Testing, which I still need to sit down and learn properly, but I’m still trying to find a suitable entry point to teach myself, and of late been expanding my knowledge using Code Academy, more on that in another post!

So thats a short update on PHP Development in general, you can checkout the ATech API Class so far on GitHub. Feedback always welcome!

(I’m trying to write more on my blog, as well as more PHP in general, hence a in progress post instead of a “It’s completely finished give it a whirl” post)

Using Zombaio with WordPress, A WordPress Plugin

Zombaio Logo

οΏΌBuilding on my work at Your Members, specifically the Adult Payment Gateway Zombaio, I’ve finally gotten around to building a better “recommended WordPress Plugin”.
As the one on Zombaio’s site is little more than a nasty hack sitting in front of WordPress without using any WordPress functions or its Database Abstraction Layer, (it’s using Raw Database functions and is not very WordPress’y at all).

It has now been released (current version at time of writing is V1.0.4) and made available via WordPress extend called WP-Zombaio.

What does the Plugin do?

Logs

Essentially the plugin listens for ping backs for the Payment Gateway and responds accordingly, creating or deleting the user, using the details passed back from Zombaio, and logging the full result for later reference.

Installing the plugin first guides you thru a easy to use install procedure, meaning no fiddly file editing, or trying to setup and understand ZScript.

Just download, unzip, upload and activate.
Nip thru the (optional) four step quick start wizard and away, you, go!

It’s a Wizard Harry
Settings all Done

In addition to the quick setup and user create/delete, the plugin provides a few short codes and widgets, to direct the user from your site off to the Zombaio Join Form and back again.

ShortCodes and Widgets!

Guide

Included in the plugin is a guide, which describes how to setup and use all the features as well as general information about running a Membership Site and getting the most out of the plugin. Especially the Zombaio Seal, which can be a little fiddly to get the code for.

Getting the Seal Code

Security and Access Control

On top of the basic functionality, is included a method to block non members from accessing the site and providing a Splash Page/adult content warning page, meaning no need for additional plugins required to do this, saving you overhead. All guests are redirected to this page, so content is protected!

A Basic Landing Page

As well as this, included in the plugin is the ability to create a menu to show to logged out users that is different to logged in users, in case your theme doesn’t provide this.

Menus

To top it all, the plugin is designed to run your WordPress site with “Anyone can Register” disabled, meaning the only way users can join is via the Zombaio Payment Form, and this means users/members have paid for access.

What is Coming Next?

I’m currently working on a update, which includes credit purchase, and the spending of credits on access to posts/pages, (this can be configured to be timed access, for Live Broadcasts/Webcam Events, or permanent access, like a image gallery), again helpful instructions and information is included in the guide on how to setup and use these features.

(The update is currently in beta testing to a couple of users who have contacted me about the plugin, but you can always grab the SVN trunk/current build and give the current credits implementation a go! You can grab this from Extend, no guarantee that it is stable or safe to use in production/live, you can get it from the WP Zombaio Developers Tab)

Suddenly Graphs

In addition I’m adding graphs and reporting data, to supplement the Zombaio Graphs and reporting to help Admins set how their site is doing. And showing what users are spending their credits on, and how many unspent credits are in the user kitty!

During the development of the next version, to fully support credit purchase in a admin easy to setup and use method, further development time is needed to create a little form builder, as there are several options, which can be difficult to easily describe using just WordPress short code Arguments, hence this blog post is talking about the current release and not about the next release including credits!).

So I shall finish this blog post off quickly and get back to finishing off the next version!

Can I see more Screenshots?

Sure, just pop over to the WordPress Extend page, there are a few more there!

Where can I get it

You can check out the Plugin here on the site, or over on Extend.

I need Help!

If you have any suggestions, feature requests or need help setting up and using the plugin, please do not hesitate to drop me a line, and I’ll be able to give you a hand and get you up and running!

I’d like to Donate

Cool! I put a quick an easy PayPal button on the local WP Zombaio Page for you!